mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 03:12:15 +00:00
fix(editor): Fix importing workflow node renaming algorithm (no-changelog) (#15139)
This commit is contained in:
@@ -1514,7 +1514,7 @@ export function useCanvasOperations({ router }: { router: ReturnType<typeof useR
|
||||
const nodeNameTable: {
|
||||
[key: string]: string;
|
||||
} = {};
|
||||
const newNodeNames = new Set<string>();
|
||||
const newNodeNames = new Set<string>((data.nodes ?? []).map((node) => node.name));
|
||||
|
||||
if (!data.nodes) {
|
||||
// No nodes to add
|
||||
@@ -1554,9 +1554,10 @@ export function useCanvasOperations({ router }: { router: ReturnType<typeof useR
|
||||
|
||||
const localized = i18n.localizeNodeName(node.name, node.type);
|
||||
|
||||
newNodeNames.delete(oldName);
|
||||
newName = uniqueNodeName(localized, Array.from(newNodeNames));
|
||||
|
||||
newNodeNames.add(newName);
|
||||
|
||||
nodeNameTable[oldName] = newName;
|
||||
|
||||
createNodes.push(node);
|
||||
|
||||
Reference in New Issue
Block a user