From 145aa8d5c5f8e924c692adee02c178133c415a26 Mon Sep 17 00:00:00 2001 From: Terje Karlsen Date: Tue, 10 Oct 2023 10:51:03 +0200 Subject: [PATCH] Fikser feil i initiering av unleash-client --- src/server/api-handlers/features.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/api-handlers/features.ts b/src/server/api-handlers/features.ts index 7a432d2bb..a24ccdd85 100644 --- a/src/server/api-handlers/features.ts +++ b/src/server/api-handlers/features.ts @@ -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; }, {}); }; @@ -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)); };