From 510fde1fce14b49104664f8470ab5f2698b5b265 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Wed, 7 Jan 2026 14:35:53 +0000 Subject: [PATCH] Changes --- src/pages/user/ProfilePage.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/pages/user/ProfilePage.tsx b/src/pages/user/ProfilePage.tsx index 2fe7bba..4e8cf15 100644 --- a/src/pages/user/ProfilePage.tsx +++ b/src/pages/user/ProfilePage.tsx @@ -25,8 +25,13 @@ export default function ProfilePage() { } }, [user?.full_name]); - // Fetch organizations + // Fetch organizations only when user is available useEffect(() => { + if (!user) { + setOrgsLoading(false); + return; + } + const fetchOrgs = async () => { try { const response = await api.users.organizations(); @@ -45,7 +50,7 @@ export default function ProfilePage() { }; fetchOrgs(); - }, []); + }, [user]); const getInitials = (fullName: string | null) => { if (!fullName) return "?";