Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 411a63f

Browse files
authored
Avoid trying to set room account data for pinned events as guest (#11216)
1 parent 05c2ee0 commit 411a63f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/views/right_panel/PinnedMessagesCard.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,11 @@ const PinnedMessagesCard: React.FC<IProps> = ({ room, onClose, permalinkCreator
103103
const readPinnedEvents = useReadPinnedEvents(room);
104104

105105
useEffect(() => {
106+
if (!cli || cli.isGuest()) return; // nothing to do
106107
const newlyRead = pinnedEventIds.filter((id) => !readPinnedEvents.has(id));
107108
if (newlyRead.length > 0) {
108109
// clear out any read pinned events which no longer are pinned
109-
cli?.setRoomAccountData(room.roomId, ReadPinsEventId, {
110+
cli.setRoomAccountData(room.roomId, ReadPinsEventId, {
110111
event_ids: pinnedEventIds,
111112
});
112113
}

0 commit comments

Comments
 (0)