Update and expand ways to access pinned messages (#7906)

* Hide pinned messages header button when nothing is pinned

Signed-off-by: Robin Townsend <robin@robin.town>

* Add pinned messages option to room info panel

Signed-off-by: Robin Townsend <robin@robin.town>

* Add pinned messages option to room header menu

Signed-off-by: Robin Townsend <robin@robin.town>

* Make condition more concise

Signed-off-by: Robin Townsend <robin@robin.town>
This commit is contained in:
Robin 2022-02-28 09:52:16 -05:00 committed by GitHub
parent 33657947d3
commit 464bb727db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 51 additions and 1 deletions

View file

@ -82,7 +82,7 @@ const PinnedMessagesHeaderButton = ({ room, isHighlighted, onClick }: IHeaderBut
const pinningEnabled = useSettingValue("feature_pinning");
const pinnedEvents = usePinnedEvents(pinningEnabled && room);
const readPinnedEvents = useReadPinnedEvents(pinningEnabled && room);
if (!pinningEnabled) return null;
if (!pinnedEvents?.length) return null;
let unreadIndicator;
if (pinnedEvents.some(id => !readPinnedEvents.has(id))) {