From bf33775a14f87f6adfb54070a7c8f428f74db73c Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 12 Apr 2021 11:45:22 +0100 Subject: [PATCH] Fix space store wrongly switching to a non-space filter --- src/stores/SpaceStore.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/stores/SpaceStore.tsx b/src/stores/SpaceStore.tsx index dec8832792..52060f86a5 100644 --- a/src/stores/SpaceStore.tsx +++ b/src/stores/SpaceStore.tsx @@ -376,16 +376,16 @@ export class SpaceStoreClass extends AsyncStoreWithClient { this.onRoomsUpdate(); } - // if the user was looking at the room and then joined select that space - if (room.getMyMembership() === "join" && room.roomId === RoomViewStore.getRoomId()) { - this.setActiveSpace(room); - } - if (room.getMyMembership() === "join") { - const numSuggestedRooms = this._suggestedRooms.length; - this._suggestedRooms = this._suggestedRooms.filter(r => r.room_id !== room.roomId); - if (numSuggestedRooms !== this._suggestedRooms.length) { - this.emit(SUGGESTED_ROOMS, this._suggestedRooms); + if (!room.isSpaceRoom()) { + const numSuggestedRooms = this._suggestedRooms.length; + this._suggestedRooms = this._suggestedRooms.filter(r => r.room_id !== room.roomId); + if (numSuggestedRooms !== this._suggestedRooms.length) { + this.emit(SUGGESTED_ROOMS, this._suggestedRooms); + } + } else if (room.roomId === RoomViewStore.getRoomId()) { + // if the user was looking at the space and then joined: select that space + this.setActiveSpace(room); } } };