mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 23:01:09 +03:00
Avoid hard-coding returnFalse and returnTrue handle fetching. (#3091)
This commit is contained in:
@@ -581,9 +581,15 @@ export const buildFlow = async ({
|
|||||||
if (reactFlowNode.data.name === 'ifElseFunction' && typeof outputResult === 'object') {
|
if (reactFlowNode.data.name === 'ifElseFunction' && typeof outputResult === 'object') {
|
||||||
let sourceHandle = ''
|
let sourceHandle = ''
|
||||||
if (outputResult.type === true) {
|
if (outputResult.type === true) {
|
||||||
sourceHandle = `${nodeId}-output-returnFalse-string|number|boolean|json|array`
|
// sourceHandle = `${nodeId}-output-returnFalse-string|number|boolean|json|array`
|
||||||
|
sourceHandle = (
|
||||||
|
reactFlowNode.data.outputAnchors.flatMap((n) => n.options).find((n) => n?.name === 'returnFalse') as any
|
||||||
|
)?.id
|
||||||
} else if (outputResult.type === false) {
|
} else if (outputResult.type === false) {
|
||||||
sourceHandle = `${nodeId}-output-returnTrue-string|number|boolean|json|array`
|
// sourceHandle = `${nodeId}-output-returnTrue-string|number|boolean|json|array`
|
||||||
|
sourceHandle = (
|
||||||
|
reactFlowNode.data.outputAnchors.flatMap((n) => n.options).find((n) => n?.name === 'returnTrue') as any
|
||||||
|
)?.id
|
||||||
}
|
}
|
||||||
|
|
||||||
const ifElseEdge = reactFlowEdges.find((edg) => edg.source === nodeId && edg.sourceHandle === sourceHandle)
|
const ifElseEdge = reactFlowEdges.find((edg) => edg.source === nodeId && edg.sourceHandle === sourceHandle)
|
||||||
|
|||||||
Reference in New Issue
Block a user