From 9c69ed387ff592b67dd8bc0085570ea8fed0a138 Mon Sep 17 00:00:00 2001
From: Nick Baur <79518844+baurnick@users.noreply.github.com>
Date: Thu, 8 Aug 2024 18:46:31 +0200
Subject: [PATCH] DEAR-136: add loading to useEffect
---
app/(main)/(home)/page.tsx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/(main)/(home)/page.tsx b/app/(main)/(home)/page.tsx
index f923763..05f2297 100644
--- a/app/(main)/(home)/page.tsx
+++ b/app/(main)/(home)/page.tsx
@@ -55,10 +55,10 @@ const Home: React.FC = () => {
};
React.useEffect(() => {
- if (user && !user.hasTeam) {
+ if (!isLoading && user && !user.hasTeam) {
router.push('/onboarding');
}
- }, [user, router]);
+ }, [isLoading, user, router]);
if (isLoading) return ;
if (error) return ;