Show badges in beta (behind a new feature flag)

Co-authored-by: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com>
This commit is contained in:
automated-signal 2021-11-17 13:42:29 -08:00 committed by GitHub
parent 4e5ccb5ed4
commit aadd41939c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -25,6 +25,7 @@ export type ConfigKeyType =
| 'desktop.senderKey.retry'
| 'desktop.sendSenderKey3'
| 'desktop.showUserBadges'
| 'desktop.showUserBadges.beta'
| 'desktop.storage'
| 'desktop.storageWrite3'
| 'desktop.usernames'

View File

@ -3,14 +3,23 @@
import { isEnabled } from '../RemoteConfig';
import { getEnvironment, Environment } from '../environment';
import { isBeta } from '../util/version';
export function shouldShowBadges(): boolean {
return (
if (
isEnabled('desktop.showUserBadges') ||
isEnabled('desktop.internalUser') ||
getEnvironment() === Environment.Staging ||
getEnvironment() === Environment.Development ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Boolean((window as any).STORYBOOK_ENV)
);
) {
return true;
}
if (isEnabled('desktop.showUserBadges.beta') && isBeta(window.getVersion())) {
return true;
}
return false;
}