Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
Fikser feil i initiering av unleash-client
Browse files Browse the repository at this point in the history
  • Loading branch information
terjeofnorway committed Oct 10, 2023
1 parent 90f55c8 commit 145aa8d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/server/api-handlers/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const initializeUnleash = async () => {

const resolveRequestedFeatures = (requestedFeatures: string[]) => {
return requestedFeatures.reduce((acc: Features, feature: string) => {
acc[feature] = unleashInstance ? unleashInstance.isEnabled(feature) : defaultToggles[feature];
acc[feature] = unleashInstance.isSynchronized() ? unleashInstance.isEnabled(feature) : defaultToggles[feature];
return acc;
}, {});
};
Expand All @@ -55,6 +55,7 @@ export const getFeaturesHandler: RequestHandler = async (req, res) => {
}

const requestedFeatures: string[] = forceArray(query.feature).filter((feature) => typeof feature === 'string');
console.log(resolveRequestedFeatures(requestedFeatures));
res.json(resolveRequestedFeatures(requestedFeatures));
};

Expand Down

0 comments on commit 145aa8d

Please sign in to comment.