From c57a4cb090900024fd141b6f7e9b8d4fc3562b1a Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 25 Jul 2023 13:58:29 +0100 Subject: [PATCH] Fix peeked rooms showing up in historical (#11316) --- src/stores/room-list/algorithms/Algorithm.ts | 2 ++ src/utils/membership.ts | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/stores/room-list/algorithms/Algorithm.ts b/src/stores/room-list/algorithms/Algorithm.ts index 36a84bf157..86b6898a74 100644 --- a/src/stores/room-list/algorithms/Algorithm.ts +++ b/src/stores/room-list/algorithms/Algorithm.ts @@ -548,6 +548,8 @@ export class Algorithm extends EventEmitter { const tags: TagID[] = []; const membership = getEffectiveMembership(room.getMyMembership()); + if (!membership) return []; // peeked room has no tags + if (membership === EffectiveMembership.Invite) { tags.push(DefaultTagID.Invite); } else if (membership === EffectiveMembership.Leave) { diff --git a/src/utils/membership.ts b/src/utils/membership.ts index b0bebe448d..b63864228c 100644 --- a/src/utils/membership.ts +++ b/src/utils/membership.ts @@ -56,7 +56,11 @@ export function splitRoomsByMembership(rooms: Room[]): MembershipSplit { }; for (const room of rooms) { - split[getEffectiveMembership(room.getMyMembership())].push(room); + const membership = room.getMyMembership(); + // Filter out falsey relationship as this will be peeked rooms + if (!!membership) { + split[getEffectiveMembership(membership)].push(room); + } } return split;