Skip to content

Commit

Permalink
fix: remove duplicated form.getFieldValue in `ensureValidAccelerato…
Browse files Browse the repository at this point in the history
…rType` (#2698)
  • Loading branch information
yomybaby authored Sep 9, 2024
1 parent 40b6062 commit 7eaa5f1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions react/src/components/ResourceAllocationFormItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,10 @@ const ResourceAllocationFormItems: React.FC<
}, [checkPresetInfo?.presets, resourceLimits, currentImage]);

const ensureValidAcceleratorType = useEventNotStable(() => {
const currentAcceleratorType = form.getFieldValue(
form.getFieldValue(['resource', 'acceleratorType']),
);
const currentAcceleratorType = form.getFieldValue([
'resource',
'acceleratorType',
]);
// If the current accelerator type is not available,
// change accelerator type to the first supported accelerator
const nextAcceleratorType: string = acceleratorSlots[currentAcceleratorType]
Expand Down

0 comments on commit 7eaa5f1

Please sign in to comment.