Always show buttons immediately - set loading to false synchronously
cgen-4de9bcdc6b7b410aacc4338228a2fa8b
This commit is contained in:
parent
2e5563fe59
commit
d386535a63
1 changed files with 2 additions and 8 deletions
|
|
@ -339,17 +339,11 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({
|
||||||
});
|
});
|
||||||
|
|
||||||
// Don't wait for rolesPromise - continue immediately
|
// Don't wait for rolesPromise - continue immediately
|
||||||
// Always set loading to false, even if role fetching hasn't completed
|
setLoading(false);
|
||||||
setTimeout(() => {
|
|
||||||
setLoading(false);
|
|
||||||
}, 100);
|
|
||||||
return userProfile;
|
return userProfile;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error fetching user profile:", error);
|
console.error("Error fetching user profile:", error);
|
||||||
// Always set loading to false even on error
|
setLoading(false);
|
||||||
setTimeout(() => {
|
|
||||||
setLoading(false);
|
|
||||||
}, 100);
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue