Skip to content

Commit

Permalink
DEAR-136: add loading to useEffect
Browse files Browse the repository at this point in the history
  • Loading branch information
baurnick committed Aug 8, 2024
1 parent 03910ad commit 9c69ed3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/(main)/(home)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Loading />;
if (error) return <Error errorMessage="It seems there was a problem loading your account." action="/" showContact />;
Expand Down

0 comments on commit 9c69ed3

Please sign in to comment.