mirror of
https://github.com/langgenius/dify.git
synced 2026-04-29 20:48:01 +08:00
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)
|
if(condition.varType === VarType.boolean)
|
||||||
return true
|
return true
|
||||||
// eslint-disable-next-line sonarjs/prefer-single-boolean-return
|
// 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 true
|
||||||
return false
|
return false
|
||||||
}, [condition])
|
}, [condition])
|
||||||
|
|||||||
@ -11,8 +11,8 @@ import cn from '@/utils/classnames'
|
|||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
className?: string
|
className?: string
|
||||||
list: any[]
|
list: boolean[]
|
||||||
onChange: (list: string[]) => void
|
onChange: (list: boolean[]) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
const ArrayValueList: FC<Props> = ({
|
const ArrayValueList: FC<Props> = ({
|
||||||
@ -23,7 +23,7 @@ const ArrayValueList: FC<Props> = ({
|
|||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
|
||||||
const handleChange = useCallback((index: number) => {
|
const handleChange = useCallback((index: number) => {
|
||||||
return (value: string) => {
|
return (value: boolean) => {
|
||||||
const newList = produce(list, (draft: any[]) => {
|
const newList = produce(list, (draft: any[]) => {
|
||||||
draft[index] = value
|
draft[index] = value
|
||||||
})
|
})
|
||||||
@ -42,7 +42,7 @@ const ArrayValueList: FC<Props> = ({
|
|||||||
|
|
||||||
const handleItemAdd = useCallback(() => {
|
const handleItemAdd = useCallback(() => {
|
||||||
const newList = produce(list, (draft: any[]) => {
|
const newList = produce(list, (draft: any[]) => {
|
||||||
draft.push('false')
|
draft.push(false)
|
||||||
})
|
})
|
||||||
onChange(newList)
|
onChange(newList)
|
||||||
}, [list, onChange])
|
}, [list, onChange])
|
||||||
|
|||||||
@ -150,7 +150,7 @@ const ChatVariableModal = ({
|
|||||||
if(v === ChatVarType.Boolean)
|
if(v === ChatVarType.Boolean)
|
||||||
setValue(true)
|
setValue(true)
|
||||||
if (v === ChatVarType.ArrayBoolean)
|
if (v === ChatVarType.ArrayBoolean)
|
||||||
setValue([true])
|
setValue([false])
|
||||||
setType(v)
|
setType(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user