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

Avoid being stuck in a space #5891

Merged
merged 2 commits into from
Apr 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/stores/SpaceStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,13 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
const room = this.matrixClient?.getRoom(payload.room_id);

// 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);
}

Expand Down