Skip to content

Commit

Permalink
Show badges in beta (behind a new feature flag)
Browse files Browse the repository at this point in the history
Co-authored-by: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com>
  • Loading branch information
automated-signal and EvanHahn-Signal committed Nov 17, 2021
1 parent 4e5ccb5 commit aadd419
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions ts/RemoteConfig.ts
Expand Up @@ -25,6 +25,7 @@ export type ConfigKeyType =
| 'desktop.senderKey.retry'
| 'desktop.sendSenderKey3'
| 'desktop.showUserBadges'
| 'desktop.showUserBadges.beta'
| 'desktop.storage'
| 'desktop.storageWrite3'
| 'desktop.usernames'
Expand Down
13 changes: 11 additions & 2 deletions ts/badges/shouldShowBadges.ts
Expand Up @@ -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;
}

0 comments on commit aadd419

Please sign in to comment.