Skip to content

Commit

Permalink
Fix usePartFields hook (#7868)
Browse files Browse the repository at this point in the history
  • Loading branch information
SchrodingersGat authored Aug 14, 2024
1 parent b0a864a commit 2244f5f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/frontend/src/forms/PartForms.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export function usePartFields({
}: {
create?: boolean;
}): ApiFormFieldSet {
const settings = useGlobalSettingsState.getState();

return useMemo(() => {
const fields: ApiFormFieldSet = {
category: {
Expand Down Expand Up @@ -93,8 +95,6 @@ export function usePartFields({
};
}

const settings = useGlobalSettingsState.getState();

if (settings.isSet('PART_REVISION_ASSEMBLY_ONLY')) {
fields.revision_of.filters['assembly'] = true;
}
Expand All @@ -111,7 +111,7 @@ export function usePartFields({
}

return fields;
}, [create]);
}, [create, settings]);
}

/**
Expand Down

0 comments on commit 2244f5f

Please sign in to comment.