Skip to content

Commit

Permalink
fix: Correct case for FeatureFlag type [skip pizza] (#2694)
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr authored Jan 23, 2024
1 parent 759f56f commit e37849c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions editor.planx.uk/src/lib/featureFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ const AVAILABLE_FEATURE_FLAGS = [
"SHOW_INTERNAL_FEEDBACK",
] as const;

type featureFlag = (typeof AVAILABLE_FEATURE_FLAGS)[number];
type FeatureFlag = (typeof AVAILABLE_FEATURE_FLAGS)[number];

/**
* get list of feature flags that have been enabled for this session
* @returns Set of feature flag strings
*/
const activeFeatureFlags = (() => {
let flags: Set<featureFlag> = new Set();
let flags: Set<FeatureFlag> = new Set();
try {
const existingFlags = localStorage.getItem("FEATURE_FLAGS");
if (existingFlags) {
Expand All @@ -28,7 +28,7 @@ const activeFeatureFlags = (() => {
* @param autoReload reload the page after change? default = true
*/
export const toggleFeatureFlag = (
featureFlag: featureFlag,
featureFlag: FeatureFlag,
autoReload = true,
) => {
const supportedFlag = AVAILABLE_FEATURE_FLAGS.includes(featureFlag);
Expand Down Expand Up @@ -56,7 +56,7 @@ export const toggleFeatureFlag = (
* @param flag flag name
* @returns boolean
*/
export const hasFeatureFlag = (featureFlag: featureFlag) =>
export const hasFeatureFlag = (featureFlag: FeatureFlag) =>
activeFeatureFlags.has(featureFlag);

// add methods to window for easy access in browser console
Expand Down

0 comments on commit e37849c

Please sign in to comment.