This commit is contained in:
gpt-engineer-app[bot]
2026-01-07 14:35:53 +00:00
parent 62f7bc248a
commit 510fde1fce
+7 -2
View File
@@ -25,8 +25,13 @@ export default function ProfilePage() {
} }
}, [user?.full_name]); }, [user?.full_name]);
// Fetch organizations // Fetch organizations only when user is available
useEffect(() => { useEffect(() => {
if (!user) {
setOrgsLoading(false);
return;
}
const fetchOrgs = async () => { const fetchOrgs = async () => {
try { try {
const response = await api.users.organizations(); const response = await api.users.organizations();
@@ -45,7 +50,7 @@ export default function ProfilePage() {
}; };
fetchOrgs(); fetchOrgs();
}, []); }, [user]);
const getInitials = (fullName: string | null) => { const getInitials = (fullName: string | null) => {
if (!fullName) return "?"; if (!fullName) return "?";