Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 9dce9b7

Browse files
committed
fix: ensure metaspace changes correctly notify listeners
1 parent e1d11db commit 9dce9b7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/stores/spaces/SpaceStore.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,13 +1072,19 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
10721072
?.["m.room_versions"]?.["org.matrix.msc3244.room_capabilities"]?.["restricted"];
10731073
});
10741074

1075+
const oldMetaSpaces = this._enabledMetaSpaces;
10751076
const enabledMetaSpaces = SettingsStore.getValue("Spaces.enabledMetaSpaces");
10761077
this._enabledMetaSpaces = metaSpaceOrder.filter(k => enabledMetaSpaces[k]);
10771078

10781079
this._allRoomsInHome = SettingsStore.getValue("Spaces.allRoomsInHome");
10791080
this.sendUserProperties();
10801081

10811082
this.rebuildSpaceHierarchy(); // trigger an initial update
1083+
// rebuildSpaceHierarchy will only send an update if the spaces have changed.
1084+
// If only the meta spaces have changed, we need to send an update ourselves.
1085+
if (arrayHasDiff(oldMetaSpaces, this._enabledMetaSpaces)) {
1086+
this.emit(UPDATE_TOP_LEVEL_SPACES, this.spacePanelSpaces, this.enabledMetaSpaces);
1087+
}
10821088

10831089
// restore selected state from last session if any and still valid
10841090
const lastSpaceId = window.localStorage.getItem(ACTIVE_SPACE_LS_KEY);

0 commit comments

Comments
 (0)