Avoid copying duplicate nodes to internal clipboard

This commit is contained in:
Nick O'Leary 2020-07-06 13:25:08 +01:00
parent 176a0ff99b
commit 73448a6039
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
1 changed files with 8 additions and 0 deletions

View File

@ -2137,8 +2137,13 @@ RED.view = (function() {
var nns = []; var nns = [];
var nodeCount = 0; var nodeCount = 0;
var groupCount = 0; var groupCount = 0;
var handled = {};
for (var n=0;n<nodes.length;n++) { for (var n=0;n<nodes.length;n++) {
var node = nodes[n]; var node = nodes[n];
if (handled[node.id]) {
continue;
}
handled[node.id] = true;
// The only time a node.type == subflow can be selected is the // The only time a node.type == subflow can be selected is the
// input/output "proxy" nodes. They cannot be copied. // input/output "proxy" nodes. They cannot be copied.
if (node.type != "subflow") { if (node.type != "subflow") {
@ -4874,6 +4879,9 @@ RED.view = (function() {
if (n._def.button) { if (n._def.button) {
nodeButtonClicked(n); nodeButtonClicked(n);
} }
},
clipboard: function() {
return clipboard
} }
}; };
})(); })();