From 09ce29f2a14309d8e025be5978254b18cdde845d Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Fri, 8 Aug 2025 10:17:48 +0000 Subject: [PATCH] Simplify the loading state check to avoid getting stuck cgen-6183cca4bf6c427381c3a3a7ec07fd34 --- client/pages/Dashboard.tsx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/client/pages/Dashboard.tsx b/client/pages/Dashboard.tsx index 2bc8b0d7..3184577d 100644 --- a/client/pages/Dashboard.tsx +++ b/client/pages/Dashboard.tsx @@ -132,19 +132,24 @@ export default function Dashboard() { } }; - // Return early if auth is still loading - if (authLoading) { + // Don't show loading screen if no user - just redirect + if (!user) { + return null; + } + + // Show loading only if we have a user but are still loading data + if (authLoading || isLoading) { return ( ); } - // If auth is complete but no user, the useEffect will handle redirect - if (!user || !profile) { + // Don't render if no profile + if (!profile) { return null; }