mirror of
https://github.com/langgenius/dify.git
synced 2026-04-24 09:06:42 +08:00
fix: if value show
This commit is contained in:
parent
37de3b1b68
commit
efa28453be
@ -7,6 +7,7 @@ import { isEmptyRelatedOperator } from './utils'
|
|||||||
import type { Condition, IfElseNodeType } from './types'
|
import type { Condition, IfElseNodeType } from './types'
|
||||||
import ConditionValue from './components/condition-value'
|
import ConditionValue from './components/condition-value'
|
||||||
import ConditionFilesListValue from './components/condition-files-list-value'
|
import ConditionFilesListValue from './components/condition-files-list-value'
|
||||||
|
import { VarType } from '../../types'
|
||||||
const i18nPrefix = 'workflow.nodes.ifElse'
|
const i18nPrefix = 'workflow.nodes.ifElse'
|
||||||
|
|
||||||
const IfElseNode: FC<NodeProps<IfElseNodeType>> = (props) => {
|
const IfElseNode: FC<NodeProps<IfElseNodeType>> = (props) => {
|
||||||
@ -26,15 +27,14 @@ const IfElseNode: FC<NodeProps<IfElseNodeType>> = (props) => {
|
|||||||
if (isEmptyRelatedOperator(c.comparison_operator!))
|
if (isEmptyRelatedOperator(c.comparison_operator!))
|
||||||
return true
|
return true
|
||||||
|
|
||||||
return typeof c.value === 'boolean' ? true : !!c.value
|
return c.varType === VarType.boolean ? true : !!c.value
|
||||||
})
|
})
|
||||||
return isSet
|
return isSet
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (isEmptyRelatedOperator(condition.comparison_operator!))
|
if (isEmptyRelatedOperator(condition.comparison_operator!))
|
||||||
return true
|
return true
|
||||||
|
return condition.varType === VarType.boolean ? true : !!condition.value
|
||||||
return typeof condition.value === 'boolean' ? true : !!condition.value
|
|
||||||
}
|
}
|
||||||
}, [])
|
}, [])
|
||||||
const conditionNotSet = (<div className='flex h-6 items-center space-x-1 rounded-md bg-workflow-block-parma-bg px-1 text-xs font-normal text-text-secondary'>
|
const conditionNotSet = (<div className='flex h-6 items-center space-x-1 rounded-md bg-workflow-block-parma-bg px-1 text-xs font-normal text-text-secondary'>
|
||||||
@ -73,7 +73,7 @@ const IfElseNode: FC<NodeProps<IfElseNodeType>> = (props) => {
|
|||||||
<ConditionValue
|
<ConditionValue
|
||||||
variableSelector={condition.variable_selector!}
|
variableSelector={condition.variable_selector!}
|
||||||
operator={condition.comparison_operator!}
|
operator={condition.comparison_operator!}
|
||||||
value={condition.value}
|
value={condition.varType === VarType.boolean ? (!condition.value ? 'False' : condition.value) : condition.value}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user