Changes
This commit is contained in:
@@ -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 "?";
|
||||||
|
|||||||
Reference in New Issue
Block a user