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 5b770b25c4..9de4d14764 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 @@ -229,7 +229,7 @@ const ConditionItem = ({ if(condition.varType === VarType.boolean) return true // eslint-disable-next-line sonarjs/prefer-single-boolean-return - if(condition.varType === VarType.arrayBoolean && [ComparisonOperator.contains, ComparisonOperator.notContains].includes(condition.comparison_operator)) + if(condition.varType === VarType.arrayBoolean && [ComparisonOperator.contains, ComparisonOperator.notContains].includes(condition.comparison_operator!)) return true return false }, [condition]) diff --git a/web/app/components/workflow/panel/chat-variable-panel/components/array-bool-list.tsx b/web/app/components/workflow/panel/chat-variable-panel/components/array-bool-list.tsx index c6c1cfaf37..5f1dcc2298 100644 --- a/web/app/components/workflow/panel/chat-variable-panel/components/array-bool-list.tsx +++ b/web/app/components/workflow/panel/chat-variable-panel/components/array-bool-list.tsx @@ -11,8 +11,8 @@ import cn from '@/utils/classnames' type Props = { className?: string - list: any[] - onChange: (list: string[]) => void + list: boolean[] + onChange: (list: boolean[]) => void } const ArrayValueList: FC = ({ @@ -23,7 +23,7 @@ const ArrayValueList: FC = ({ const { t } = useTranslation() const handleChange = useCallback((index: number) => { - return (value: string) => { + return (value: boolean) => { const newList = produce(list, (draft: any[]) => { draft[index] = value }) @@ -42,7 +42,7 @@ const ArrayValueList: FC = ({ const handleItemAdd = useCallback(() => { const newList = produce(list, (draft: any[]) => { - draft.push('false') + draft.push(false) }) onChange(newList) }, [list, onChange]) diff --git a/web/app/components/workflow/panel/chat-variable-panel/components/variable-modal.tsx b/web/app/components/workflow/panel/chat-variable-panel/components/variable-modal.tsx index e9265c0f35..2502db05e7 100644 --- a/web/app/components/workflow/panel/chat-variable-panel/components/variable-modal.tsx +++ b/web/app/components/workflow/panel/chat-variable-panel/components/variable-modal.tsx @@ -150,7 +150,7 @@ const ChatVariableModal = ({ if(v === ChatVarType.Boolean) setValue(true) if (v === ChatVarType.ArrayBoolean) - setValue([true]) + setValue([false]) setType(v) }