Empty object if nothing saved

This isn't nice but I'll rework this soon anyway

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner
2021-03-26 08:15:35 +01:00
parent efb8c89433
commit 7e425ce939

View File

@@ -117,7 +117,7 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
// view last selected room from space
const spaceId = space?.roomId || LAST_VIEWED_ROOMS_HOME;
const lastViewedRooms = JSON.parse(window.localStorage.getItem(LAST_VIEWED_ROOMS));
const lastViewedRooms = JSON.parse(window.localStorage.getItem(LAST_VIEWED_ROOMS)) || {};
const roomId = lastViewedRooms[spaceId];
if (roomId) {