Fix fetchUserProfile to ensure loading state clears

cgen-2304fa8b229249d49b8154f21330cb30
This commit is contained in:
Builder.io 2025-08-16 04:21:31 +00:00
parent cce06096d8
commit 9efe4170ef

View file

@ -137,9 +137,11 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({
try { try {
const userProfile = await aethexUserService.getCurrentUser(); const userProfile = await aethexUserService.getCurrentUser();
setProfile(userProfile); setProfile(userProfile);
setLoading(false);
return userProfile; return userProfile;
} catch (error) { } catch (error) {
console.error("Error fetching user profile:", error); console.error("Error fetching user profile:", error);
setLoading(false);
return null; return null;
} }
}; };