diff --git a/src/stores/SpaceStore.tsx b/src/stores/SpaceStore.tsx index 453cccdc17..3d476f7077 100644 --- a/src/stores/SpaceStore.tsx +++ b/src/stores/SpaceStore.tsx @@ -491,8 +491,7 @@ export class SpaceStoreClass extends AsyncStoreWithClient { switch (payload.action) { case "view_room": { // persist last viewed room from a space - const activeSpace = SpaceStore.instance.activeSpace; - const activeSpaceId = activeSpace?.roomId || LAST_VIEWED_ROOMS_HOME; + const activeSpaceId = this.activeSpace?.roomId || LAST_VIEWED_ROOMS_HOME; const lastViewedRooms = JSON.parse(window.localStorage.getItem(LAST_VIEWED_ROOMS)) || {}; lastViewedRooms[activeSpaceId] = payload.room_id;