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); }