Show badges in beta (behind a new feature flag)

This commit is contained in:
Evan Hahn 2021-11-17 15:25:17 -06:00 committed by GitHub
parent 54c60ebb4f
commit 42b45a14b7
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;
}