From 6d3865bdd5421132856f25e953553ec76716c0c8 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 29 Nov 2021 11:26:10 +0000 Subject: [PATCH] Respect the home page as a context for the Home space (#7216) --- src/stores/spaces/SpaceStore.ts | 8 ++++++++ 1 file changed, 8 insertions(+) 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