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