Space Panel use SettingsStore instead of SpaceStore as source of truth (#7404)
This commit is contained in:
parent
63e69d9fa8
commit
6761ef9540
2 changed files with 6 additions and 5 deletions
|
@ -97,9 +97,7 @@ export const HomeButtonContextMenu = ({
|
||||||
hideHeader,
|
hideHeader,
|
||||||
...props
|
...props
|
||||||
}: ComponentProps<typeof SpaceContextMenu>) => {
|
}: ComponentProps<typeof SpaceContextMenu>) => {
|
||||||
const allRoomsInHome = useEventEmitterState(SpaceStore.instance, UPDATE_HOME_BEHAVIOUR, () => {
|
const allRoomsInHome = useSettingValue<boolean>("Spaces.allRoomsInHome");
|
||||||
return SpaceStore.instance.allRoomsInHome;
|
|
||||||
});
|
|
||||||
|
|
||||||
return <IconizedContextMenu
|
return <IconizedContextMenu
|
||||||
{...props}
|
{...props}
|
||||||
|
|
|
@ -109,8 +109,9 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
|
||||||
private _invitedSpaces = new Set<Room>();
|
private _invitedSpaces = new Set<Room>();
|
||||||
private spaceOrderLocalEchoMap = new Map<string, string>();
|
private spaceOrderLocalEchoMap = new Map<string, string>();
|
||||||
private _restrictedJoinRuleSupport?: IRoomCapability;
|
private _restrictedJoinRuleSupport?: IRoomCapability;
|
||||||
private _allRoomsInHome: boolean = SettingsStore.getValue("Spaces.allRoomsInHome");
|
// The following properties are set by onReady as they live in account_data
|
||||||
private _enabledMetaSpaces: MetaSpace[] = []; // set by onReady
|
private _allRoomsInHome = false;
|
||||||
|
private _enabledMetaSpaces: MetaSpace[] = [];
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super(defaultDispatcher, {});
|
super(defaultDispatcher, {});
|
||||||
|
@ -1042,6 +1043,8 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
|
||||||
const enabledMetaSpaces = SettingsStore.getValue("Spaces.enabledMetaSpaces");
|
const enabledMetaSpaces = SettingsStore.getValue("Spaces.enabledMetaSpaces");
|
||||||
this._enabledMetaSpaces = metaSpaceOrder.filter(k => enabledMetaSpaces[k]) as MetaSpace[];
|
this._enabledMetaSpaces = metaSpaceOrder.filter(k => enabledMetaSpaces[k]) as MetaSpace[];
|
||||||
|
|
||||||
|
this._allRoomsInHome = SettingsStore.getValue("Spaces.allRoomsInHome");
|
||||||
|
|
||||||
this.rebuildSpaceHierarchy(); // trigger an initial update
|
this.rebuildSpaceHierarchy(); // trigger an initial update
|
||||||
|
|
||||||
// restore selected state from last session if any and still valid
|
// restore selected state from last session if any and still valid
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue