fix:another build error

This commit is contained in:
Ida Dittrich 2026-01-05 06:42:38 +01:00
parent 6315c9a1ba
commit 6c90a00677

View file

@ -558,7 +558,8 @@ export function useOrgUsers() {
// Ensure attributes are loaded - can be called by EditActionButton
const ensureAttributesLoaded = useCallback(async () => {
// Don't fetch attributes if user is not authenticated (prevents 401 errors)
if (!user) {
const currentUser = getUserDataCache();
if (!currentUser) {
return [];
}
@ -568,15 +569,16 @@ export function useOrgUsers() {
const fetchedAttributes = await fetchAttributes();
return fetchedAttributes;
}, [attributes, fetchAttributes, user]);
}, [attributes, fetchAttributes]);
// Fetch attributes and permissions on mount (only if user is authenticated)
useEffect(() => {
if (user) {
const currentUser = getUserDataCache();
if (currentUser) {
fetchAttributes();
fetchPermissions();
}
}, [fetchAttributes, fetchPermissions, user]);
}, [fetchAttributes, fetchPermissions]);
// Initial fetch
useEffect(() => {