mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Fix importing node to currently flow rather than match its old z value
If you import a node whose z value is a known existing tab, it is getting imported to that tab, rather than the expected behaviour of being imported to the current tab. This commit fixes that by checked if the node is being imported to a tab that was included in the import, rather than pre-existing.
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user