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 81ac4b771..7f7778ee8 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 @@ -849,40 +849,47 @@ RED.nodes = (function() { subflowSet.push(n); } }); + RED.nodes.eachConfig(function(n) { + if (n.z == subflowId) { + subflowSet.push(n); + } + }); var exportableSubflow = createExportableNodeSet(subflowSet, exportedIds, exportedSubflows, exportedConfigNodes); nns = exportableSubflow.concat(nns); } } if (node.type !== "subflow") { - var convertedNode = RED.nodes.convertNode(node); - for (var d in node._def.defaults) { - if (node._def.defaults[d].type) { - var nodeList = node[d]; - if (!Array.isArray(nodeList)) { - nodeList = [nodeList]; - } - nodeList = nodeList.filter(function(id) { - if (id in configNodes) { - var confNode = configNodes[id]; - if (confNode._def.exportable !== false) { - if (!(id in exportedConfigNodes)) { - exportedConfigNodes[id] = true; - set.push(confNode); - return true; - } - } - return false; + if (nns.findIndex((v) => v && v.id === node.id) == -1) { + var convertedNode = RED.nodes.convertNode(node); + for (var d in node._def.defaults) { + if (node._def.defaults[d].type) { + var nodeList = node[d]; + if (!Array.isArray(nodeList)) { + nodeList = [nodeList]; + } + nodeList = nodeList.filter(function(id) { + if (id in configNodes) { + var confNode = configNodes[id]; + if (confNode._def.exportable !== false) { + if (!(id in exportedConfigNodes)) { + exportedConfigNodes[id] = true; + set.push(confNode); + return true; + } + } + return false; + } + return true; + }) + if (nodeList.length === 0) { + convertedNode[d] = Array.isArray(node[d])?[]:"" + } else { + convertedNode[d] = Array.isArray(node[d])?nodeList:nodeList[0] } - return true; - }) - if (nodeList.length === 0) { - convertedNode[d] = Array.isArray(node[d])?[]:"" - } else { - convertedNode[d] = Array.isArray(node[d])?nodeList:nodeList[0] } } + nns.push(convertedNode); } - nns.push(convertedNode); if (node.type === "group") { nns = nns.concat(createExportableNodeSet(node.nodes, exportedIds, exportedSubflows, exportedConfigNodes)); }