mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 11:47:23 +03:00
Merge pull request #5891 from SimonBrandner/fix/context-switching
Avoid being stuck in a space
This commit is contained in:
commit
eba0fbf902
1 changed files with 7 additions and 1 deletions
|
@ -514,7 +514,13 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
|
||||||
const room = this.matrixClient?.getRoom(payload.room_id);
|
const room = this.matrixClient?.getRoom(payload.room_id);
|
||||||
|
|
||||||
// persist last viewed room from a space
|
// persist last viewed room from a space
|
||||||
if (room) {
|
|
||||||
|
// Don't save if the room is a space room. This would cause a problem:
|
||||||
|
// When switching to a space home, we first view that room and
|
||||||
|
// only after that we switch to that space. This causes us to
|
||||||
|
// save the space home to be the last viewed room in the home
|
||||||
|
// space.
|
||||||
|
if (room && !room.isSpaceRoom()) {
|
||||||
window.localStorage.setItem(getLastViewedRoomsStorageKey(this.activeSpace), payload.room_id);
|
window.localStorage.setItem(getLastViewedRoomsStorageKey(this.activeSpace), payload.room_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue