Use compound keys
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>pull/21833/head
parent
f64008e239
commit
f62e2c0042
|
@ -117,8 +117,7 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
|
||||||
|
|
||||||
// view last selected room from space
|
// view last selected room from space
|
||||||
const spaceId = space?.roomId || LAST_VIEWED_ROOMS_HOME;
|
const spaceId = space?.roomId || LAST_VIEWED_ROOMS_HOME;
|
||||||
const lastViewedRooms = JSON.parse(window.localStorage.getItem(LAST_VIEWED_ROOMS)) || {};
|
const roomId = window.localStorage.getItem(`${LAST_VIEWED_ROOMS}_${spaceId}`);
|
||||||
const roomId = lastViewedRooms[spaceId];
|
|
||||||
|
|
||||||
if (roomId) {
|
if (roomId) {
|
||||||
defaultDispatcher.dispatch({
|
defaultDispatcher.dispatch({
|
||||||
|
@ -500,10 +499,7 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
|
||||||
// space room since it can cause problems
|
// space room since it can cause problems
|
||||||
if (room && !room.isSpaceRoom()) {
|
if (room && !room.isSpaceRoom()) {
|
||||||
const activeSpaceId = this.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)) || {};
|
window.localStorage.setItem(`${LAST_VIEWED_ROOMS}_${activeSpaceId}`, payload.room_id);
|
||||||
|
|
||||||
lastViewedRooms[activeSpaceId] = payload.room_id;
|
|
||||||
window.localStorage.setItem(LAST_VIEWED_ROOMS, JSON.stringify(lastViewedRooms));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (room?.getMyMembership() === "join") {
|
if (room?.getMyMembership() === "join") {
|
||||||
|
|
Loading…
Reference in New Issue