From d386535a6331daf897b2de64ff5edede2b9426db Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sat, 8 Nov 2025 09:15:05 +0000 Subject: [PATCH] Always show buttons immediately - set loading to false synchronously cgen-4de9bcdc6b7b410aacc4338228a2fa8b --- client/contexts/AuthContext.tsx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/client/contexts/AuthContext.tsx b/client/contexts/AuthContext.tsx index d9728dfa..6890dd07 100644 --- a/client/contexts/AuthContext.tsx +++ b/client/contexts/AuthContext.tsx @@ -339,17 +339,11 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ }); // Don't wait for rolesPromise - continue immediately - // Always set loading to false, even if role fetching hasn't completed - setTimeout(() => { - setLoading(false); - }, 100); + setLoading(false); return userProfile; } catch (error) { console.error("Error fetching user profile:", error); - // Always set loading to false even on error - setTimeout(() => { - setLoading(false); - }, 100); + setLoading(false); return null; } };