From 9b81f5b4a034c3f791f7083bb0607e4ca7b9ab10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Tue, 20 Apr 2021 16:11:34 +0200 Subject: [PATCH] Add a comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/stores/SpaceStore.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/stores/SpaceStore.tsx b/src/stores/SpaceStore.tsx index e9be7c1e5e..dc0c691505 100644 --- a/src/stores/SpaceStore.tsx +++ b/src/stores/SpaceStore.tsx @@ -514,6 +514,12 @@ export class SpaceStoreClass extends AsyncStoreWithClient { 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); }