Skip to content

Commit

Permalink
Merge pull request #381 from systemli/fix-unauthenticated-feature-con…
Browse files Browse the repository at this point in the history
…text

🚑 Make FeatureContext work when unauthenticated
  • Loading branch information
0x46616c6b authored Oct 9, 2022
2 parents 30bbf20 + 8bffd29 commit 19131b8
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/components/useFeature.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ export function FeatureProvider({
const { getFeatures } = useFeatureApi(token)

useEffect(() => {
getFeatures().then(response => {
setFeatures(response.data.features)

setLoadingInitial(false)
})
getFeatures()
.then(response => {
setFeatures(response.data.features)
})
.finally(() => {
setLoadingInitial(false)
})
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])

Expand Down

0 comments on commit 19131b8

Please sign in to comment.