Guard render against premature redirect; show nothing only when redirecting condition met
cgen-0f1c083ad7784113b586659a13c98789
This commit is contained in:
parent
dfebb544cf
commit
d9d1e1ae44
1 changed files with 2 additions and 7 deletions
|
|
@ -154,13 +154,8 @@ export default function Dashboard() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Don't show loading screen if no user - just redirect
|
// While auth is resolving or data is loading, show loading screen
|
||||||
if (!user) {
|
if (authLoading || isLoading || !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..."
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue