From b84a0300aa69cd77d6b4b0aef6f758cceeed55bf Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 1 Oct 2021 08:58:46 +0100 Subject: [PATCH 1/2] Fix leaving space via other client leaving you in undefined-land --- src/stores/SpaceStore.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/stores/SpaceStore.ts b/src/stores/SpaceStore.ts index 5f243a9d5dd..4d54f5b553b 100644 --- a/src/stores/SpaceStore.ts +++ b/src/stores/SpaceStore.ts @@ -608,6 +608,9 @@ export class SpaceStoreClass extends AsyncStoreWithClient { if (membership === "join" && room.roomId === RoomViewStore.getRoomId()) { // if the user was looking at the space and then joined: select that space this.setActiveSpace(room, false); + } else if (membership === "leave") { + // user's active space has gone away, go back to home + this.setActiveSpace(null, true); } }; From 273a895caaf4c9255ef24818084596794620f316 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 1 Oct 2021 09:25:47 +0100 Subject: [PATCH 2/2] fix logic --- src/stores/SpaceStore.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stores/SpaceStore.ts b/src/stores/SpaceStore.ts index 4d54f5b553b..bb22aa4dbb4 100644 --- a/src/stores/SpaceStore.ts +++ b/src/stores/SpaceStore.ts @@ -608,7 +608,7 @@ export class SpaceStoreClass extends AsyncStoreWithClient { if (membership === "join" && room.roomId === RoomViewStore.getRoomId()) { // if the user was looking at the space and then joined: select that space this.setActiveSpace(room, false); - } else if (membership === "leave") { + } else if (membership === "leave" && room.roomId === this.activeSpace?.roomId) { // user's active space has gone away, go back to home this.setActiveSpace(null, true); }