Skip to content

Commit

Permalink
Allow dev without split.io flag (#1258)
Browse files Browse the repository at this point in the history
  • Loading branch information
codemonkey800 authored Sep 13, 2023
1 parent 5c107f9 commit b6cfd17
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions frontend/src/utils/ssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ export function getServerSidePropsHandler<
Object.keys(I18nResources),
);

const featureFlags = E2E
? getEnabledFeatureFlags(...FEATURE_FLAG_LIST)
: await FLAG_CACHE.get(FLAG_CACHE_KEY, () =>
getFeatureFlags(req.url ?? '/'),
);
const featureFlags =
E2E || !process.env.SPLIT_IO_SERVER_KEY
? getEnabledFeatureFlags(...FEATURE_FLAG_LIST)
: await FLAG_CACHE.get(FLAG_CACHE_KEY, () =>
getFeatureFlags(req.url ?? '/'),
);

// Assign to feature flag store so that server code can use the state.
Object.assign(featureFlagsStore, featureFlags);
Expand Down

0 comments on commit b6cfd17

Please sign in to comment.