mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-13 15:09:00 +08:00
fix: input vars not auto rename in list operator (#9550)
This commit is contained in:
parent
f83ed19dfe
commit
65e22bb76a
@ -739,6 +739,11 @@ export const getNodeUsedVars = (node: Node): ValueSelector[] => {
|
||||
res = [(data as IterationNodeType).iterator_selector]
|
||||
break
|
||||
}
|
||||
|
||||
case BlockEnum.ListFilter: {
|
||||
res = [(data as ListFilterNodeType).variable]
|
||||
break
|
||||
}
|
||||
}
|
||||
return res || []
|
||||
}
|
||||
@ -997,6 +1002,12 @@ export const updateNodeVars = (oldNode: Node, oldVarSelector: ValueSelector, new
|
||||
|
||||
break
|
||||
}
|
||||
case BlockEnum.ListFilter: {
|
||||
const payload = data as ListFilterNodeType
|
||||
if (payload.variable.join('.') === oldVarSelector.join('.'))
|
||||
payload.variable = newVarSelector
|
||||
break
|
||||
}
|
||||
}
|
||||
})
|
||||
return newNode
|
||||
|
@ -67,7 +67,7 @@ const useConfig = (id: string, payload: ListFilterNodeType) => {
|
||||
const itemVarTypeShowName = useMemo(() => {
|
||||
if (!inputs.variable)
|
||||
return '?'
|
||||
return [itemVarType.substring(0, 1).toUpperCase(), itemVarType.substring(1)].join('')
|
||||
return [(itemVarType || VarType.string).substring(0, 1).toUpperCase(), (itemVarType || VarType.string).substring(1)].join('')
|
||||
}, [inputs.variable, itemVarType])
|
||||
|
||||
const hasSubVariable = [VarType.arrayFile].includes(varType)
|
||||
|
Loading…
x
Reference in New Issue
Block a user