1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Only validate nodes once they have all been imported

This ensures any checks for dependent config nodes will pass
This commit is contained in:
Nick O'Leary 2020-06-04 17:06:29 +01:00
parent a7a949377b
commit 4c28b5b227
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -1377,10 +1377,6 @@ RED.nodes = (function() {
return (otherNode && otherNode.z === activeWorkspace)
});
}
// With all properties now remapped to point at valid nodes,
// we can validate the node
RED.editor.validateNode(n);
}
for (i=0;i<new_subflows.length;i++) {
n = new_subflows[i];
@ -1435,6 +1431,12 @@ RED.nodes = (function() {
for (i=0;i<new_nodes.length;i++) {
var node = new_nodes[i];
addNode(node);
}
// Finally validate them all.
// This has to be done after everything is added so that any checks for
// dependent config nodes will pass
for (i=0;i<new_nodes.length;i++) {
var node = new_nodes[i];
RED.editor.validateNode(node);
}