Simplify the loading state check to avoid getting stuck
cgen-6183cca4bf6c427381c3a3a7ec07fd34
This commit is contained in:
parent
8bf8ac94a2
commit
09ce29f2a1
1 changed files with 10 additions and 5 deletions
|
|
@ -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 (
|
||||
<LoadingScreen
|
||||
message="Loading your dashboard..."
|
||||
showProgress={true}
|
||||
duration={2000}
|
||||
duration={1500}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue