Fixed adding to an empty workspace
This commit is contained in:
parent
89208e2d38
commit
6dd38c3c16
@ -103,9 +103,13 @@ export default {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
const max_id = maxBy(this.diagram.nodes, 'id').id
|
if (this.diagram.nodes.length > 0) {
|
||||||
|
const max_id = maxBy(this.diagram.nodes, 'id').id
|
||||||
|
|
||||||
newNode.id = max_id + 1;
|
newNode.id = max_id + 1;
|
||||||
|
} else {
|
||||||
|
newNode.id = 0;
|
||||||
|
}
|
||||||
|
|
||||||
this.diagram.nodes.push(newNode)
|
this.diagram.nodes.push(newNode)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user