Add a comment

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
pull/21833/head
Šimon Brandner 2021-04-20 16:11:34 +02:00
parent 3adb2635ba
commit 9b81f5b4a0
No known key found for this signature in database
GPG Key ID: 9760693FDD98A790
1 changed files with 6 additions and 0 deletions

View File

@ -514,6 +514,12 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
const room = this.matrixClient?.getRoom(payload.room_id);
// persist last viewed room from a space
// 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);
}