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

Commit

Permalink
Respect the home page as a context for the Home space (#7216)
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy authored Nov 29, 2021
1 parent 3ffe752 commit 6d3865b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/stores/spaces/SpaceStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
} else {
defaultDispatcher.dispatch({
action: "view_home_page",
context_switch: true,
});
}
}
Expand Down Expand Up @@ -854,6 +855,13 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
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
Expand Down

0 comments on commit 6d3865b

Please sign in to comment.