From 87e560de8aad71b8c67bb178830bf8213f4aecca Mon Sep 17 00:00:00 2001 From: Joel Date: Wed, 25 Sep 2024 15:19:28 +0800 Subject: [PATCH] chore: type value change to array --- .../components/condition-list/condition-item.tsx | 8 ++++---- web/app/components/workflow/nodes/if-else/default.ts | 2 +- .../list-filter/components/filter-condition.tsx | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/web/app/components/workflow/nodes/if-else/components/condition-list/condition-item.tsx b/web/app/components/workflow/nodes/if-else/components/condition-list/condition-item.tsx index c56ecf4a1a..abc7904244 100644 --- a/web/app/components/workflow/nodes/if-else/components/condition-list/condition-item.tsx +++ b/web/app/components/workflow/nodes/if-else/components/condition-list/condition-item.tsx @@ -128,14 +128,14 @@ const ConditionItem = ({ return undefined }, [condition.key, file, isSubVariableKey]) - const isTransferMethod = fileAttr?.key === 'transfer_method' + const isArrayValue = fileAttr?.key === 'transfer_method' || fileAttr?.key === 'type' const handleUpdateConditionValue = useCallback((value: string) => { - if (value === condition.value || (isTransferMethod && value === condition.value?.[0])) + if (value === condition.value || (isArrayValue && value === condition.value?.[0])) return const newCondition = { ...condition, - value: isTransferMethod ? [value] : value, + value: isArrayValue ? [value] : value, } doUpdateCondition(newCondition) }, [condition, doUpdateCondition, fileAttr]) @@ -273,7 +273,7 @@ const ConditionItem = ({ handleChange('value')(item.value)} className='!text-[13px]' wrapperClassName='grow h-8'