Use this.activeSpace

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Š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

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;