Fix fetchUserProfile to ensure loading state clears
cgen-2304fa8b229249d49b8154f21330cb30
This commit is contained in:
parent
cce06096d8
commit
9efe4170ef
1 changed files with 2 additions and 0 deletions
|
|
@ -137,9 +137,11 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({
|
|||
try {
|
||||
const userProfile = await aethexUserService.getCurrentUser();
|
||||
setProfile(userProfile);
|
||||
setLoading(false);
|
||||
return userProfile;
|
||||
} catch (error) {
|
||||
console.error("Error fetching user profile:", error);
|
||||
setLoading(false);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue