Merge pull request #6797 from matrix-org/t3chguy/fix/19025

pull/21833/head
Michael Telatynski 2021-09-14 15:56:20 +01:00 committed by GitHub
commit 9928079b82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 2 deletions

View File

@ -629,11 +629,18 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
};
private onRoom = (room: Room, newMembership?: string, oldMembership?: string) => {
const membership = newMembership || room.getMyMembership();
const roomMembership = room.getMyMembership();
if (!roomMembership) {
// room is still being baked in the js-sdk, we'll process it at Room.myMembership instead
return;
}
const membership = newMembership || roomMembership;
if (!room.isSpaceRoom()) {
// this.onRoomUpdate(room);
this.onRoomsUpdate();
// this.onRoomsUpdate();
// ideally we only need onRoomsUpdate here but it doesn't rebuild parentMap so always adds new rooms to Home
this.rebuild();
if (membership === "join") {
// the user just joined a room, remove it from the suggested list if it was there