Skip to content

Commit

Permalink
fix: allow the isHidden feature flag config to overwrite client state (
Browse files Browse the repository at this point in the history
  • Loading branch information
cwhitten authored Dec 4, 2020
1 parent 98eb0f2 commit 577663e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Composer/packages/server/src/services/featureFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ export class FeatureFlagService {

let saveNeeded = false;

// check if a hidden feature flag is no longer hidden
defaultFeatureFlagKeys.forEach((key: string) => {
const currentFlag = FeatureFlagService.currentFeatureFlagMap[key];
const defaultFlag = FeatureFlagService.defaultFeatureFlags[key];
if (currentFlag.isHidden !== defaultFlag.isHidden) {
FeatureFlagService.currentFeatureFlagMap[key].isHidden = FeatureFlagService.defaultFeatureFlags[key].isHidden;
saveNeeded = true;
}
});

// add any new keys defined in the defaults that aren't in current
defaultFeatureFlagKeys
.filter((key: string) => !currentFeatureFlagKeys.includes(key))
Expand Down

0 comments on commit 577663e

Please sign in to comment.