fix:another build error
This commit is contained in:
parent
6315c9a1ba
commit
6c90a00677
1 changed files with 6 additions and 4 deletions
|
|
@ -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(() => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue