Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 6d3865b

Browse files
authored
Respect the home page as a context for the Home space (#7216)
1 parent 3ffe752 commit 6d3865b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/stores/spaces/SpaceStore.ts

+8
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
230230
} else {
231231
defaultDispatcher.dispatch({
232232
action: "view_home_page",
233+
context_switch: true,
233234
});
234235
}
235236
}
@@ -854,6 +855,13 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
854855
break;
855856
}
856857

858+
case "view_home_page":
859+
if (!payload.context_switch && this.enabledMetaSpaces.includes(MetaSpace.Home)) {
860+
this.setActiveSpace(MetaSpace.Home, false);
861+
window.localStorage.setItem(getSpaceContextKey(this.activeSpace), "");
862+
}
863+
break;
864+
857865
case "after_leave_room":
858866
if (this._activeSpace[0] === "!" && payload.room_id === this._activeSpace) {
859867
// User has left the current space, go to first space

0 commit comments

Comments
 (0)