signal-desktop/ts/util/isScreenSharingEnabled.ts

18 lines
569 B
TypeScript
Raw Normal View History

// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import * as RemoteConfig from '../RemoteConfig';
import { isBeta } from './version';
// We can remove this function once screen sharing has been turned on for everyone
export function isScreenSharingEnabled(): boolean {
2021-06-04 14:55:18 +00:00
// `window.getVersion` is missing in Storybook.
const version = window.getVersion?.();
return Boolean(
RemoteConfig.isEnabled('desktop.worksAtSignal') ||
2021-06-04 14:55:18 +00:00
RemoteConfig.isEnabled('desktop.screensharing2') ||
(version && isBeta(version))
);
}