From d591ffe9dd23817b98a23549f693125de2f55100 Mon Sep 17 00:00:00 2001 From: Jong Eun Lee Date: Mon, 9 Sep 2024 18:41:17 +0800 Subject: [PATCH] fix: remove duplicated `form.getFieldValue` in `ensureValidAcceleratorType` --- react/src/components/ResourceAllocationFormItems.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/react/src/components/ResourceAllocationFormItems.tsx b/react/src/components/ResourceAllocationFormItems.tsx index 473fb800a5..ca2cf7a83e 100644 --- a/react/src/components/ResourceAllocationFormItems.tsx +++ b/react/src/components/ResourceAllocationFormItems.tsx @@ -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]