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 174892d43..9b580f9a0 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 @@ -1424,6 +1424,8 @@ RED.nodes = (function() { nid = getID(); workspace_map[n.id] = nid; n.id = nid; + } else { + workspace_map[n.id] = n.id; } addWorkspace(n); RED.workspaces.add(n); @@ -1523,7 +1525,7 @@ RED.nodes = (function() { } } } else { - if (n.z && !workspaces[n.z] && !subflow_map[n.z]) { + if (n.z && !workspace_map[n.z] && !subflow_map[n.z]) { n.z = activeWorkspace; } } @@ -1621,7 +1623,7 @@ RED.nodes = (function() { node.id = getID(); } else { node.id = n.id; - if (node.z == null || (!workspaces[node.z] && !subflow_map[node.z])) { + if (node.z == null || (!workspace_map[node.z] && !subflow_map[node.z])) { if (createMissingWorkspace) { if (missingWorkspace === null) { missingWorkspace = RED.workspaces.add(null,true);