mirror of https://github.com/langgenius/dify.git
fix: query selector set sys value problem
This commit is contained in:
parent
d0509213d1
commit
74ead43ae1
|
|
@ -88,7 +88,7 @@ const VarReferencePicker: FC<Props> = ({
|
|||
|
||||
return getNodeInfoById(availableNodes, outputVarNodeId)?.data
|
||||
})()
|
||||
const varName = hasValue ? value[value.length - 1] : ''
|
||||
const varName = hasValue ? `${isSystemVar(value as ValueSelector) ? 'sys.' : ''}${value[value.length - 1]}` : ''
|
||||
|
||||
const getVarType = () => {
|
||||
if (isConstant)
|
||||
|
|
|
|||
|
|
@ -76,7 +76,12 @@ const Item: FC<ItemProps> = ({
|
|||
}, [isHovering])
|
||||
const handleChosen = (e: React.MouseEvent) => {
|
||||
e.stopPropagation()
|
||||
onChange([nodeId, ...objPath, itemData.variable], itemData)
|
||||
if (itemData.variable.startsWith('sys.')) { // system variable
|
||||
onChange([...objPath, ...itemData.variable.split('.')], itemData)
|
||||
}
|
||||
else {
|
||||
onChange([nodeId, ...objPath, itemData.variable], itemData)
|
||||
}
|
||||
}
|
||||
return (
|
||||
<PortalToFollowElem
|
||||
|
|
|
|||
Loading…
Reference in New Issue