From b342691ecf9ad877c1617a63ddcdab879fd863a1 Mon Sep 17 00:00:00 2001 From: Antoine Dewez <44063631+Zewed@users.noreply.github.com> Date: Thu, 21 Mar 2024 12:35:49 -0700 Subject: [PATCH] fix(frontend): onBoarding issue (#2374) # Description Please include a summary of the changes and the related issue. Please also include relevant motivation and context. ## Checklist before requesting a review Please delete options that are not relevant. - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my code - [ ] I have commented hard-to-understand areas - [ ] I have ideally added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged ## Screenshots (if appropriate): --- .../context/OnboardingProvider/Onboarding-provider.tsx | 6 ++++-- frontend/lib/hooks/useUserData.ts | 9 ++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/frontend/lib/context/OnboardingProvider/Onboarding-provider.tsx b/frontend/lib/context/OnboardingProvider/Onboarding-provider.tsx index a0e93ca6e..3b2512068 100644 --- a/frontend/lib/context/OnboardingProvider/Onboarding-provider.tsx +++ b/frontend/lib/context/OnboardingProvider/Onboarding-provider.tsx @@ -20,8 +20,10 @@ export const OnboardingProvider = ({ const { userIdentityData } = useUserData(); useEffect(() => { - setIsOnboardingModalOpened(!!userIdentityData?.onboarded); - }, []); + if (userIdentityData) { + setIsOnboardingModalOpened(!userIdentityData.onboarded); + } + }, [userIdentityData]); return ( { +export const useUserData = (): UseUserDataProps => { const { getUser } = useUserApi(); const { getUserIdentity } = useUserApi();