Allow call links beta
This commit is contained in:
parent
a0b7539620
commit
2acc5f26f9
3 changed files with 29 additions and 2 deletions
|
@ -16,7 +16,9 @@ import { getCountryCode } from './types/PhoneNumber';
|
||||||
|
|
||||||
export type ConfigKeyType =
|
export type ConfigKeyType =
|
||||||
| 'desktop.calling.adhoc'
|
| 'desktop.calling.adhoc'
|
||||||
|
| 'desktop.calling.adhoc.beta'
|
||||||
| 'desktop.calling.adhoc.create'
|
| 'desktop.calling.adhoc.create'
|
||||||
|
| 'desktop.calling.adhoc.create.beta'
|
||||||
| 'desktop.calling.ringrtcAdm'
|
| 'desktop.calling.ringrtcAdm'
|
||||||
| 'desktop.clientExpiration'
|
| 'desktop.clientExpiration'
|
||||||
| 'desktop.backup.credentialFetch'
|
| 'desktop.backup.credentialFetch'
|
||||||
|
|
|
@ -15,6 +15,7 @@ import {
|
||||||
type CallHistoryDetails,
|
type CallHistoryDetails,
|
||||||
CallMode,
|
CallMode,
|
||||||
} from '../types/CallDisposition';
|
} from '../types/CallDisposition';
|
||||||
|
import { isBeta, isProduction } from './version';
|
||||||
|
|
||||||
export const CALL_LINK_DEFAULT_STATE: Pick<
|
export const CALL_LINK_DEFAULT_STATE: Pick<
|
||||||
CallLinkType,
|
CallLinkType,
|
||||||
|
@ -43,7 +44,20 @@ export function isCallLinksCreateEnabled(): boolean {
|
||||||
if (isTestOrMockEnvironment()) {
|
if (isTestOrMockEnvironment()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const version = window.getVersion();
|
||||||
|
|
||||||
|
if (isProduction(version)) {
|
||||||
return RemoteConfig.getValue('desktop.calling.adhoc.create') === 'TRUE';
|
return RemoteConfig.getValue('desktop.calling.adhoc.create') === 'TRUE';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isBeta(version)) {
|
||||||
|
return (
|
||||||
|
RemoteConfig.getValue('desktop.calling.adhoc.create.beta') === 'TRUE'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function callLinkToConversation(
|
export function callLinkToConversation(
|
||||||
|
|
|
@ -2,7 +2,18 @@
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import * as RemoteConfig from '../RemoteConfig';
|
import * as RemoteConfig from '../RemoteConfig';
|
||||||
|
import { isBeta, isProduction } from './version';
|
||||||
|
|
||||||
export function isAdhocCallingEnabled(): boolean {
|
export function isAdhocCallingEnabled(): boolean {
|
||||||
|
const version = window.getVersion();
|
||||||
|
|
||||||
|
if (isProduction(version)) {
|
||||||
return Boolean(RemoteConfig.isEnabled('desktop.calling.adhoc'));
|
return Boolean(RemoteConfig.isEnabled('desktop.calling.adhoc'));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isBeta(version)) {
|
||||||
|
return Boolean(RemoteConfig.isEnabled('desktop.calling.adhoc.beta'));
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue