diff --git a/src/stores/spaces/SpaceStore.ts b/src/stores/spaces/SpaceStore.ts index 83e6ae07ad..34d8adafd8 100644 --- a/src/stores/spaces/SpaceStore.ts +++ b/src/stores/spaces/SpaceStore.ts @@ -230,6 +230,7 @@ export class SpaceStoreClass extends AsyncStoreWithClient { } else { defaultDispatcher.dispatch({ action: "view_home_page", + context_switch: true, }); } } @@ -854,6 +855,13 @@ export class SpaceStoreClass extends AsyncStoreWithClient { break; } + case "view_home_page": + if (!payload.context_switch && this.enabledMetaSpaces.includes(MetaSpace.Home)) { + this.setActiveSpace(MetaSpace.Home, false); + window.localStorage.setItem(getSpaceContextKey(this.activeSpace), ""); + } + break; + case "after_leave_room": if (this._activeSpace[0] === "!" && payload.room_id === this._activeSpace) { // User has left the current space, go to first space