Fix loading state when redirecting unauthenticated users
cgen-517c2edf6285418898f00795ccca7b7d
This commit is contained in:
parent
7fa9354d60
commit
d882260575
1 changed files with 3 additions and 0 deletions
|
|
@ -56,12 +56,15 @@ export default function Dashboard() {
|
|||
|
||||
useEffect(() => {
|
||||
if (!authLoading && !user) {
|
||||
setIsLoading(false);
|
||||
navigate("/login");
|
||||
return;
|
||||
}
|
||||
|
||||
if (user && profile) {
|
||||
loadDashboardData();
|
||||
} else if (!authLoading) {
|
||||
setIsLoading(false);
|
||||
}
|
||||
}, [user, profile, authLoading, navigate]);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue