From c848d5ff815a3a73c969b30c5eb8b7b3208fd9de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20R=C3=B6sel?= <320272+Traxmaxx@users.noreply.github.com> Date: Wed, 4 Oct 2023 13:50:43 +0200 Subject: [PATCH] fix: prevent redirecting when not visiting the onboarding wizard --- dashboard/components/layout/Layout.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dashboard/components/layout/Layout.tsx b/dashboard/components/layout/Layout.tsx index 26c6b424e..b2b8f08b4 100644 --- a/dashboard/components/layout/Layout.tsx +++ b/dashboard/components/layout/Layout.tsx @@ -28,7 +28,11 @@ function Layout({ children }: LayoutProps) { useEffect(() => { settingsService.getOnboardingStatus().then(res => { - if (res.onboarded === true && res.status === 'COMPLETE') { + if ( + res.onboarded === true && + res.status === 'COMPLETE' && + router.asPath.includes('/onboarding/') + ) { router.replace('/dashboard/'); } else if (res.onboarded === false && res.status === 'PENDING_DATABASE') { router.replace('/onboarding/choose-database');