Plumb through new ADM setting.
Co-authored-by: ayumi-signal <ayumi@signal.org>
This commit is contained in:
parent
fc7eba772c
commit
c8a729f8be
5 changed files with 47 additions and 0 deletions
31
ts/util/ringrtc/ringrtcAdm.ts
Normal file
31
ts/util/ringrtc/ringrtcAdm.ts
Normal file
|
@ -0,0 +1,31 @@
|
|||
// Copyright 2024 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import * as RemoteConfig from '../../RemoteConfig';
|
||||
import OS from '../os/osMain';
|
||||
import { isProduction } from '../version';
|
||||
|
||||
export function getUseRingrtcAdm(): boolean {
|
||||
const localUseRingrtcAdm = window.storage.get('useRingrtcAdm');
|
||||
if (localUseRingrtcAdm !== undefined) {
|
||||
return localUseRingrtcAdm;
|
||||
}
|
||||
|
||||
if (
|
||||
isProduction(window.getVersion()) ||
|
||||
OS.isLinux() ||
|
||||
!RemoteConfig.isEnabled('desktop.internalUser')
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return RemoteConfig.isEnabled('desktop.calling.ringrtcAdm');
|
||||
}
|
||||
|
||||
export async function setUseRingrtcAdm(value: boolean): Promise<void> {
|
||||
await window.storage.put('useRingrtcAdm', value);
|
||||
}
|
||||
|
||||
export async function removeUseRingrtcAdm(): Promise<void> {
|
||||
await window.storage.remove('useRingrtcAdm');
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue