From 2244f5fb278b10be72efa7ddcbdb853875f8aed5 Mon Sep 17 00:00:00 2001 From: Oliver Date: Wed, 14 Aug 2024 10:49:36 +1000 Subject: [PATCH] Fix usePartFields hook (#7868) --- src/frontend/src/forms/PartForms.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/frontend/src/forms/PartForms.tsx b/src/frontend/src/forms/PartForms.tsx index b6145ab553..8b93a65f86 100644 --- a/src/frontend/src/forms/PartForms.tsx +++ b/src/frontend/src/forms/PartForms.tsx @@ -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]); } /**