Delabs Spaces, keeping it as a default-on preference for the time being

This commit is contained in:
Michael Telatynski 2021-08-11 14:52:40 +01:00
parent 40cf05a3ce
commit be85dcd1bf
14 changed files with 170 additions and 83 deletions

View file

@ -24,7 +24,11 @@ import SettingsStore from "../SettingsStore";
* labs flags.
*/
export default class IncompatibleController extends SettingController {
public constructor(private settingName: string, private forcedValue = false) {
public constructor(
private settingName: string,
private forcedValue = false,
private incompatibleValue: any = true,
) {
super();
}
@ -34,13 +38,13 @@ export default class IncompatibleController extends SettingController {
calculatedValue: any,
calculatedAtLevel: SettingLevel,
): any {
if (this.incompatibleSettingEnabled) {
if (this.incompatibleSetting) {
return this.forcedValue;
}
return null; // no override
}
public get incompatibleSettingEnabled(): boolean {
return SettingsStore.getValue(this.settingName);
public get incompatibleSetting(): boolean {
return SettingsStore.getValue(this.settingName) === this.incompatibleValue;
}
}