From 40ea759e2c06c7d10a4e4e704a3f70939356107f Mon Sep 17 00:00:00 2001 From: Hiroyasu Nishiyama Date: Wed, 10 Mar 2021 09:03:52 +0900 Subject: [PATCH] fix vanishing link in subflow --- .../@node-red/editor-client/src/js/nodes.js | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/packages/node_modules/@node-red/editor-client/src/js/nodes.js b/packages/node_modules/@node-red/editor-client/src/js/nodes.js index fd6296ef2..32b70bc63 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/nodes.js +++ b/packages/node_modules/@node-red/editor-client/src/js/nodes.js @@ -413,6 +413,27 @@ RED.nodes = (function() { nodeTabMap[z] = {}; } nodeTabMap[z][node.id] = node; + var nl = nodeLinks[node.id]; + if (nl) { + nl.in.forEach((l) => { + var idx = linkTabMap[node.z].indexOf(l); + if (idx != -1) { + linkTabMap[node.z].splice(idx, 1); + } + if ((l.source.z === z) && linkTabMap[z]) { + linkTabMap[z].push(l); + } + }); + nl.out.forEach((l) => { + var idx = linkTabMap[node.z].indexOf(l); + if (idx != -1) { + linkTabMap[node.z].splice(idx, 1); + } + if ((l.target.z === z) && linkTabMap[z]) { + linkTabMap[z].push(l); + } + }); + } node.z = z; RED.events.emit("nodes:change",node); }