You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-11 20:22:36 +03:00
Don't save if isSpaceRoom()
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
@@ -490,15 +490,20 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
|
|||||||
if (!SettingsStore.getValue("feature_spaces")) return;
|
if (!SettingsStore.getValue("feature_spaces")) return;
|
||||||
switch (payload.action) {
|
switch (payload.action) {
|
||||||
case "view_room": {
|
case "view_room": {
|
||||||
// persist last viewed room from a space
|
|
||||||
const activeSpaceId = this.activeSpace?.roomId || LAST_VIEWED_ROOMS_HOME;
|
|
||||||
const lastViewedRooms = JSON.parse(window.localStorage.getItem(LAST_VIEWED_ROOMS)) || {};
|
|
||||||
|
|
||||||
lastViewedRooms[activeSpaceId] = payload.room_id;
|
|
||||||
window.localStorage.setItem(LAST_VIEWED_ROOMS, JSON.stringify(lastViewedRooms));
|
|
||||||
|
|
||||||
const room = this.matrixClient?.getRoom(payload.room_id);
|
const room = this.matrixClient?.getRoom(payload.room_id);
|
||||||
|
|
||||||
|
// persist last viewed room from a space
|
||||||
|
|
||||||
|
// We don't want to save if the room is a
|
||||||
|
// space room since it can cause problems
|
||||||
|
if (!room.isSpaceRoom()) {
|
||||||
|
const activeSpaceId = this.activeSpace?.roomId || LAST_VIEWED_ROOMS_HOME;
|
||||||
|
const lastViewedRooms = JSON.parse(window.localStorage.getItem(LAST_VIEWED_ROOMS)) || {};
|
||||||
|
|
||||||
|
lastViewedRooms[activeSpaceId] = payload.room_id;
|
||||||
|
window.localStorage.setItem(LAST_VIEWED_ROOMS, JSON.stringify(lastViewedRooms));
|
||||||
|
}
|
||||||
|
|
||||||
if (room?.getMyMembership() === "join") {
|
if (room?.getMyMembership() === "join") {
|
||||||
if (room.isSpaceRoom()) {
|
if (room.isSpaceRoom()) {
|
||||||
this.setActiveSpace(room);
|
this.setActiveSpace(room);
|
||||||
|
|||||||
Reference in New Issue
Block a user