Make compact layout only apply to Modern layout (#7382)
This commit is contained in:
parent
d9da2581b4
commit
71b561d471
5 changed files with 13 additions and 11 deletions
|
@ -417,6 +417,7 @@ export const SETTINGS: {[setting: string]: ISetting} = {
|
|||
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
|
||||
displayName: _td("Use a more compact 'Modern' layout"),
|
||||
default: false,
|
||||
controller: new IncompatibleController("layout", false, v => v !== Layout.Group),
|
||||
},
|
||||
"showRedactions": {
|
||||
supportedLevels: LEVELS_ROOM_SETTINGS_WITH_ROOM,
|
||||
|
|
|
@ -27,7 +27,7 @@ export default class IncompatibleController extends SettingController {
|
|||
public constructor(
|
||||
private settingName: string,
|
||||
private forcedValue: any = false,
|
||||
private incompatibleValue: any = true,
|
||||
private incompatibleValue: any | ((v: any) => boolean) = true,
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
@ -49,6 +49,9 @@ export default class IncompatibleController extends SettingController {
|
|||
}
|
||||
|
||||
public get incompatibleSetting(): boolean {
|
||||
if (typeof this.incompatibleValue === "function") {
|
||||
return this.incompatibleValue(SettingsStore.getValue(this.settingName));
|
||||
}
|
||||
return SettingsStore.getValue(this.settingName) === this.incompatibleValue;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue