From e6bf67ae8bd48008acb3231174a2ba76452db79f Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 1 Aug 2023 20:22:15 +0100 Subject: [PATCH] Fix joining a suggested room switching space away (#11347) --- src/stores/spaces/SpaceStore.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/stores/spaces/SpaceStore.ts b/src/stores/spaces/SpaceStore.ts index e91b3c5a45..d5cf045ee9 100644 --- a/src/stores/spaces/SpaceStore.ts +++ b/src/stores/spaces/SpaceStore.ts @@ -929,6 +929,8 @@ export class SpaceStoreClass extends AsyncStoreWithClient { this._suggestedRooms = this._suggestedRooms.filter((r) => r.room_id !== room.roomId); if (numSuggestedRooms !== this._suggestedRooms.length) { this.emit(UPDATE_SUGGESTED_ROOMS, this._suggestedRooms); + // If the suggested room was present in the list then we know we don't need to switch space + return; } // if the room currently being viewed was just joined then switch to its related space