Fix subflow outbound-link filter

This commit is contained in:
GogoVega 2024-08-27 15:46:48 +02:00
parent edc01552f9
commit 2c4dc3334d
No known key found for this signature in database
GPG Key ID: E1E048B63AC5AC2B

View File

@ -2406,12 +2406,15 @@ RED.nodes = (function() {
} else { } else {
delete n.g delete n.g
} }
// If importing into a subflow, ensure an outbound-link doesn't get added // If importing a subflow, ensure an outbound-link doesn't get added
if (activeSubflow && /^link /.test(n.type) && n.links) { if (/^link /.test(n.type) && n.links) {
n.links = n.links.filter(function(id) { const isSubflow = !!getSubflow(n.z);
const otherNode = node_map[id] || RED.nodes.node(id); if (isSubflow) {
return (otherNode && otherNode.z === activeWorkspace); n.links = n.links.filter(function(id) {
}); const otherNode = node_map[id] || RED.nodes.node(id);
return (otherNode && otherNode.z === n.z);
});
}
} }
for (var d3 in n._def.defaults) { for (var d3 in n._def.defaults) {
if (n._def.defaults.hasOwnProperty(d3)) { if (n._def.defaults.hasOwnProperty(d3)) {