mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
add feature flag for cross-signing
This commit is contained in:
parent
551a9e0bc8
commit
ab67a28c74
@ -29,7 +29,12 @@ export class FeaturesViewModel extends ViewModel {
|
||||
name: this.i18n`Audio/video calls`,
|
||||
description: this.i18n`Allows starting and participating in A/V calls compatible with Element Call (MSC3401). Look for the start call option in the room menu ((...) in the right corner) to start a call.`,
|
||||
feature: FeatureFlag.Calls
|
||||
})),
|
||||
})),
|
||||
new FeatureViewModel(this.childOptions({
|
||||
name: this.i18n`Cross-Signing`,
|
||||
description: this.i18n`Allows.verifying the identity of people you chat with`,
|
||||
feature: FeatureFlag.CrossSigning
|
||||
})),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ import type {SettingsStorage} from "./platform/web/dom/SettingsStorage";
|
||||
|
||||
export enum FeatureFlag {
|
||||
Calls = 1 << 0,
|
||||
CrossSigning = 1 << 1
|
||||
}
|
||||
|
||||
export class FeatureSet {
|
||||
@ -39,6 +40,10 @@ export class FeatureSet {
|
||||
return this.isFeatureEnabled(FeatureFlag.Calls);
|
||||
}
|
||||
|
||||
get crossSigning(): boolean {
|
||||
return this.isFeatureEnabled(FeatureFlag.CrossSigning);
|
||||
}
|
||||
|
||||
static async load(settingsStorage: SettingsStorage): Promise<FeatureSet> {
|
||||
const flags = await settingsStorage.getInt("enabled_features") || 0;
|
||||
return new FeatureSet(flags);
|
||||
|
Loading…
Reference in New Issue
Block a user