update setting naming to match style
This commit is contained in:
parent
02dbdc5c0a
commit
3c436c9617
6 changed files with 9 additions and 9 deletions
|
@ -49,7 +49,7 @@ export default class PreferencesUserSettingsTab extends React.Component<{}, ISta
|
||||||
];
|
];
|
||||||
|
|
||||||
static SPACES_SETTINGS = [
|
static SPACES_SETTINGS = [
|
||||||
"Spaces.all_rooms_in_home",
|
"Spaces.allRoomsInHome",
|
||||||
];
|
];
|
||||||
|
|
||||||
static KEYBINDINGS_SETTINGS = [
|
static KEYBINDINGS_SETTINGS = [
|
||||||
|
|
|
@ -83,7 +83,7 @@ const HomeButtonContextMenu = ({ onFinished, ...props }: ComponentProps<typeof S
|
||||||
label={_t("Show all rooms")}
|
label={_t("Show all rooms")}
|
||||||
active={allRoomsInHome}
|
active={allRoomsInHome}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
SettingsStore.setValue("Spaces.all_rooms_in_home", null, SettingLevel.ACCOUNT, !allRoomsInHome);
|
SettingsStore.setValue("Spaces.allRoomsInHome", null, SettingLevel.ACCOUNT, !allRoomsInHome);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</IconizedContextMenuOptionList>
|
</IconizedContextMenuOptionList>
|
||||||
|
|
|
@ -749,7 +749,7 @@ export const SETTINGS: {[setting: string]: ISetting} = {
|
||||||
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
|
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
"Spaces.all_rooms_in_home": {
|
"Spaces.allRoomsInHome": {
|
||||||
displayName: _td("Show all rooms in Home"),
|
displayName: _td("Show all rooms in Home"),
|
||||||
description: _td("All rooms you're in will appear in Home."),
|
description: _td("All rooms you're in will appear in Home."),
|
||||||
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
|
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
|
||||||
|
|
|
@ -117,12 +117,12 @@ 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.all_rooms_in_home");
|
private _allRoomsInHome: boolean = SettingsStore.getValue("Spaces.allRoomsInHome");
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super(defaultDispatcher, {});
|
super(defaultDispatcher, {});
|
||||||
|
|
||||||
SettingsStore.monitorSetting("Spaces.all_rooms_in_home", null);
|
SettingsStore.monitorSetting("Spaces.allRoomsInHome", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public get invitedSpaces(): Room[] {
|
public get invitedSpaces(): Room[] {
|
||||||
|
@ -812,8 +812,8 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
|
||||||
|
|
||||||
case Action.SettingUpdated: {
|
case Action.SettingUpdated: {
|
||||||
const settingUpdatedPayload = payload as SettingUpdatedPayload;
|
const settingUpdatedPayload = payload as SettingUpdatedPayload;
|
||||||
if (settingUpdatedPayload.settingName === "Spaces.all_rooms_in_home") {
|
if (settingUpdatedPayload.settingName === "Spaces.allRoomsInHome") {
|
||||||
const newValue = SettingsStore.getValue("Spaces.all_rooms_in_home");
|
const newValue = SettingsStore.getValue("Spaces.allRoomsInHome");
|
||||||
if (this.allRoomsInHome !== newValue) {
|
if (this.allRoomsInHome !== newValue) {
|
||||||
this._allRoomsInHome = newValue;
|
this._allRoomsInHome = newValue;
|
||||||
this.emit(UPDATE_HOME_BEHAVIOUR, this.allRoomsInHome);
|
this.emit(UPDATE_HOME_BEHAVIOUR, this.allRoomsInHome);
|
||||||
|
|
|
@ -85,7 +85,7 @@ describe("SpaceStore", () => {
|
||||||
const setShowAllRooms = async (value: boolean) => {
|
const setShowAllRooms = async (value: boolean) => {
|
||||||
if (store.allRoomsInHome === value) return;
|
if (store.allRoomsInHome === value) return;
|
||||||
const emitProm = testUtils.emitPromise(store, UPDATE_HOME_BEHAVIOUR);
|
const emitProm = testUtils.emitPromise(store, UPDATE_HOME_BEHAVIOUR);
|
||||||
await SettingsStore.setValue("Spaces.all_rooms_in_home", null, SettingLevel.DEVICE, value);
|
await SettingsStore.setValue("Spaces.allRoomsInHome", null, SettingLevel.DEVICE, value);
|
||||||
jest.runAllTimers(); // run async dispatch
|
jest.runAllTimers(); // run async dispatch
|
||||||
await emitProm;
|
await emitProm;
|
||||||
};
|
};
|
||||||
|
|
|
@ -47,7 +47,7 @@ describe("SpaceWatcher", () => {
|
||||||
|
|
||||||
const setShowAllRooms = async (value: boolean) => {
|
const setShowAllRooms = async (value: boolean) => {
|
||||||
if (store.allRoomsInHome === value) return;
|
if (store.allRoomsInHome === value) return;
|
||||||
await SettingsStore.setValue("Spaces.all_rooms_in_home", null, SettingLevel.DEVICE, value);
|
await SettingsStore.setValue("Spaces.allRoomsInHome", null, SettingLevel.DEVICE, value);
|
||||||
await testUtils.emitPromise(store, UPDATE_HOME_BEHAVIOUR);
|
await testUtils.emitPromise(store, UPDATE_HOME_BEHAVIOUR);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue