Use this.activeSpace

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
pull/21833/head
Šimon Brandner 2021-03-26 07:58:09 +01:00
parent e39f7caf59
commit c26da1bce6
No known key found for this signature in database
GPG Key ID: 9760693FDD98A790
1 changed files with 1 additions and 2 deletions

View File

@ -491,8 +491,7 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
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;