Refine Dashboard loading/render conditions to avoid persistent overlay

cgen-486add7947fb4118a8f67dc0e739f1f7
This commit is contained in:
Builder.io 2025-09-27 20:47:55 +00:00
parent d9d1e1ae44
commit 9fb5ec70f4

View file

@ -154,13 +154,18 @@ export default function Dashboard() {
}
};
// While auth is resolving or data is loading, show loading screen
if (authLoading || isLoading || !user) {
// If no user and auth is resolved, let the redirect happen without flashing a loader
if (!user && !authLoading) {
return null;
}
// Show loading only while auth or data is loading
if (authLoading || isLoading) {
return (
<LoadingScreen
message="Loading your dashboard..."
showProgress={true}
duration={1500}
duration={1200}
/>
);
}