2021-11-09 15:51:56 +00:00
|
|
|
// Copyright 2021 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
import { isEnabled } from '../RemoteConfig';
|
|
|
|
import { getEnvironment, Environment } from '../environment';
|
2021-11-17 21:25:17 +00:00
|
|
|
import { isBeta } from '../util/version';
|
2021-11-09 15:51:56 +00:00
|
|
|
|
|
|
|
export function shouldShowBadges(): boolean {
|
2021-11-17 21:25:17 +00:00
|
|
|
if (
|
2021-11-18 21:25:17 +00:00
|
|
|
isEnabled('desktop.showUserBadges2') ||
|
2021-11-09 15:51:56 +00:00
|
|
|
isEnabled('desktop.internalUser') ||
|
|
|
|
getEnvironment() === Environment.Staging ||
|
|
|
|
getEnvironment() === Environment.Development ||
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
|
|
Boolean((window as any).STORYBOOK_ENV)
|
2021-11-17 21:25:17 +00:00
|
|
|
) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (isEnabled('desktop.showUserBadges.beta') && isBeta(window.getVersion())) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
2021-11-09 15:51:56 +00:00
|
|
|
}
|