Skip to content

Commit

Permalink
Fix new node bug (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
marthacryan committed Feb 20, 2023
1 parent 3a9f10b commit 9ee78d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function getImmediateDownstreamNodes(nodeId, links) {
function generateNodeName(type, paletteLabel, existingNodes) {
let tmpName = type === 'dictionary' ? 'MyDictionary' : paletteLabel;
const nodesWithSameName = existingNodes.filter((n) =>
n.label.toLowerCase().startsWith(tmpName.toLowerCase()),
n.label?.toLowerCase().startsWith(tmpName.toLowerCase()),
);
return `${tmpName}_${nodesWithSameName.length + 1}`;
}
Expand Down

0 comments on commit 9ee78d6

Please sign in to comment.