Fix loading state when redirecting unauthenticated users

cgen-517c2edf6285418898f00795ccca7b7d
This commit is contained in:
Builder.io 2025-08-08 10:16:25 +00:00
parent 7fa9354d60
commit d882260575

View file

@ -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]);