fix: can not get first var type

This commit is contained in:
Joel 2024-03-15 15:10:41 +08:00
parent f7a9564e11
commit 2886255c8b
1 changed files with 2 additions and 1 deletions

View File

@ -67,6 +67,7 @@ const VarReferencePicker: FC<Props> = ({
const isConstant = isSupportConstantValue && varKindType === VarKindType.static
const { getTreeLeafNodes, getBeforeNodesInSameBranch } = useWorkflow()
const availableNodes = onlyLeafNodeVar ? getTreeLeafNodes(nodeId) : getBeforeNodesInSameBranch(nodeId)
const allOutputVars = toNodeOutputVars(availableNodes, isChatMode)
const outputVars = toNodeOutputVars(availableNodes, isChatMode, filterVar)
const [open, setOpen] = useState(false)
useEffect(() => {
@ -82,7 +83,7 @@ const VarReferencePicker: FC<Props> = ({
if (isConstant)
return 'undefined'
const targetVar = outputVars.find(v => v.nodeId === outputVarNodeId)
const targetVar = allOutputVars.find(v => v.nodeId === outputVarNodeId)
if (!targetVar)
return 'undefined'