From 8996c168cabcd37c605d9246b0ea7bf3c2029bb2 Mon Sep 17 00:00:00 2001 From: Demian Caldelas Date: Sun, 20 Feb 2022 11:07:15 -0300 Subject: [PATCH] Refresh the shouldOnboard state in the Shell after onboarding (#1918) Co-authored-by: Peer Richelsen --- apps/web/components/Shell.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/web/components/Shell.tsx b/apps/web/components/Shell.tsx index 9d6b211e..09400a85 100644 --- a/apps/web/components/Shell.tsx +++ b/apps/web/components/Shell.tsx @@ -79,11 +79,11 @@ function useRedirectToOnboardingIfNeeded() { const user = query.data; const [isRedirectingToOnboarding, setRedirecting] = useState(false); + useEffect(() => { - if (user && shouldShowOnboarding(user)) { - setRedirecting(true); - } + user && setRedirecting(shouldShowOnboarding(user)); }, [router, user]); + useEffect(() => { if (isRedirectingToOnboarding) { router.replace({