Show badges in beta (behind a new feature flag)
This commit is contained in:
@@ -25,6 +25,7 @@ export type ConfigKeyType =
|
|||||||
| 'desktop.senderKey.retry'
|
| 'desktop.senderKey.retry'
|
||||||
| 'desktop.sendSenderKey3'
|
| 'desktop.sendSenderKey3'
|
||||||
| 'desktop.showUserBadges'
|
| 'desktop.showUserBadges'
|
||||||
|
| 'desktop.showUserBadges.beta'
|
||||||
| 'desktop.storage'
|
| 'desktop.storage'
|
||||||
| 'desktop.storageWrite3'
|
| 'desktop.storageWrite3'
|
||||||
| 'desktop.usernames'
|
| 'desktop.usernames'
|
||||||
|
@@ -3,14 +3,23 @@
|
|||||||
|
|
||||||
import { isEnabled } from '../RemoteConfig';
|
import { isEnabled } from '../RemoteConfig';
|
||||||
import { getEnvironment, Environment } from '../environment';
|
import { getEnvironment, Environment } from '../environment';
|
||||||
|
import { isBeta } from '../util/version';
|
||||||
|
|
||||||
export function shouldShowBadges(): boolean {
|
export function shouldShowBadges(): boolean {
|
||||||
return (
|
if (
|
||||||
isEnabled('desktop.showUserBadges') ||
|
isEnabled('desktop.showUserBadges') ||
|
||||||
isEnabled('desktop.internalUser') ||
|
isEnabled('desktop.internalUser') ||
|
||||||
getEnvironment() === Environment.Staging ||
|
getEnvironment() === Environment.Staging ||
|
||||||
getEnvironment() === Environment.Development ||
|
getEnvironment() === Environment.Development ||
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
Boolean((window as any).STORYBOOK_ENV)
|
Boolean((window as any).STORYBOOK_ENV)
|
||||||
);
|
) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isEnabled('desktop.showUserBadges.beta') && isBeta(window.getVersion())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user