fix: con vars set value

This commit is contained in:
Joel 2025-08-01 17:24:53 +08:00
parent 6287e3cd9e
commit 2bd096b454
3 changed files with 6 additions and 6 deletions

View File

@ -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])

View File

@ -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<Props> = ({
@ -23,7 +23,7 @@ const ArrayValueList: FC<Props> = ({
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<Props> = ({
const handleItemAdd = useCallback(() => {
const newList = produce(list, (draft: any[]) => {
draft.push('false')
draft.push(false)
})
onChange(newList)
}, [list, onChange])

View File

@ -150,7 +150,7 @@ const ChatVariableModal = ({
if(v === ChatVarType.Boolean)
setValue(true)
if (v === ChatVarType.ArrayBoolean)
setValue([true])
setValue([false])
setType(v)
}