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

Commit

Permalink
Fix peeked rooms showing up in historical (#11316)
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy authored Jul 25, 2023
1 parent b5cbd9e commit c57a4cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/stores/room-list/algorithms/Algorithm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 5 additions & 1 deletion src/utils/membership.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c57a4cb

Please sign in to comment.