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

Commit c57a4cb

Browse files
authored
Fix peeked rooms showing up in historical (#11316)
1 parent b5cbd9e commit c57a4cb

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/stores/room-list/algorithms/Algorithm.ts

+2
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,8 @@ export class Algorithm extends EventEmitter {
548548
const tags: TagID[] = [];
549549

550550
const membership = getEffectiveMembership(room.getMyMembership());
551+
if (!membership) return []; // peeked room has no tags
552+
551553
if (membership === EffectiveMembership.Invite) {
552554
tags.push(DefaultTagID.Invite);
553555
} else if (membership === EffectiveMembership.Leave) {

src/utils/membership.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ export function splitRoomsByMembership(rooms: Room[]): MembershipSplit {
5656
};
5757

5858
for (const room of rooms) {
59-
split[getEffectiveMembership(room.getMyMembership())].push(room);
59+
const membership = room.getMyMembership();
60+
// Filter out falsey relationship as this will be peeked rooms
61+
if (!!membership) {
62+
split[getEffectiveMembership(membership)].push(room);
63+
}
6064
}
6165

6266
return split;

0 commit comments

Comments
 (0)