Delabs Spaces, keeping it as a default-on preference for the time being
This commit is contained in:
parent
40cf05a3ce
commit
be85dcd1bf
14 changed files with 170 additions and 83 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue