Skip to content

Commit 56a2f92

Browse files
committed
devmode checking in all return locations of useFeature
1 parent d208b74 commit 56a2f92

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

modules/app-config/index.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,11 @@ const useFeature = (featureKey: AppConfigKey): boolean => {
2323
queryKey: ['app', 'app:feature-flag', featureKey],
2424
queryFn: () => getFeatureFlag(featureKey),
2525
onSuccess: (newValue) => {
26-
return newValue
26+
return isDevMode() ? newValue : false
2727
},
2828
})
2929

30-
if (!isDevMode()) {
31-
return false
32-
}
33-
34-
return featureValue
30+
return isDevMode() ? featureValue : false
3531
}
3632

3733
// exported feature flags

0 commit comments

Comments
 (0)