mirror of https://github.com/langgenius/dify.git
fix: con vars set value
This commit is contained in:
parent
6287e3cd9e
commit
2bd096b454
|
|
@ -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])
|
||||
|
|
|
|||
|
|
@ -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])
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ const ChatVariableModal = ({
|
|||
if(v === ChatVarType.Boolean)
|
||||
setValue(true)
|
||||
if (v === ChatVarType.ArrayBoolean)
|
||||
setValue([true])
|
||||
setValue([false])
|
||||
setType(v)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue