Show badges in beta (behind a new feature flag)
This commit is contained in:
parent
54c60ebb4f
commit
42b45a14b7
2 changed files with 12 additions and 2 deletions
|
@ -25,6 +25,7 @@ export type ConfigKeyType =
|
|||
| 'desktop.senderKey.retry'
|
||||
| 'desktop.sendSenderKey3'
|
||||
| 'desktop.showUserBadges'
|
||||
| 'desktop.showUserBadges.beta'
|
||||
| 'desktop.storage'
|
||||
| 'desktop.storageWrite3'
|
||||
| 'desktop.usernames'
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue