Simplify the loading state check to avoid getting stuck

cgen-6183cca4bf6c427381c3a3a7ec07fd34
This commit is contained in:
Builder.io 2025-08-08 10:17:48 +00:00
parent 8bf8ac94a2
commit 09ce29f2a1

View file

@ -132,19 +132,24 @@ export default function Dashboard() {
} }
}; };
// Return early if auth is still loading // Don't show loading screen if no user - just redirect
if (authLoading) { if (!user) {
return null;
}
// Show loading only if we have a user but are still loading data
if (authLoading || isLoading) {
return ( return (
<LoadingScreen <LoadingScreen
message="Loading your dashboard..." message="Loading your dashboard..."
showProgress={true} showProgress={true}
duration={2000} duration={1500}
/> />
); );
} }
// If auth is complete but no user, the useEffect will handle redirect // Don't render if no profile
if (!user || !profile) { if (!profile) {
return null; return null;
} }