Fix usePartFields hook (#7868)

This commit is contained in:
Oliver 2024-08-14 10:49:36 +10:00 committed by GitHub
parent b0a864a618
commit 2244f5fb27
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,6 +13,8 @@ export function usePartFields({
}: {
create?: boolean;
}): ApiFormFieldSet {
const settings = useGlobalSettingsState.getState();
return useMemo(() => {
const fields: ApiFormFieldSet = {
category: {
@ -93,8 +95,6 @@ export function usePartFields({
};
}
const settings = useGlobalSettingsState.getState();
if (settings.isSet('PART_REVISION_ASSEMBLY_ONLY')) {
fields.revision_of.filters['assembly'] = true;
}
@ -111,7 +111,7 @@ export function usePartFields({
}
return fields;
}, [create]);
}, [create, settings]);
}
/**