Respect the home page as a context for the Home space (#7216)

pull/21833/head
Michael Telatynski 2021-11-29 11:26:10 +00:00 committed by GitHub
parent 3ffe752730
commit 6d3865bdd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -230,6 +230,7 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
} else {
defaultDispatcher.dispatch({
action: "view_home_page",
context_switch: true,
});
}
}
@ -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