fix(editor): Redraw node connections if adding more than one node to canvas (#6755)

* fix(editor): Redraw node connections if adding more than one node to canvas

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>

* Update position before connection two nodes

* Lint fix

---------

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
Co-authored-by: Alex Grozav <alex@grozav.com>
This commit is contained in:
OlegIvaniv 2023-07-27 12:10:40 +02:00 committed by GitHub
parent 0e9703bba8
commit b954a50fdf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3765,9 +3765,6 @@ export default defineComponent({
const lastAddedNode = this.nodes[this.nodes.length - 1];
const previouslyAddedNode = this.nodes[this.nodes.length - 2];
await this.$nextTick();
this.connectTwoNodes(previouslyAddedNode.name, 0, lastAddedNode.name, 0);
// Position the added node to the right side of the previously added one
lastAddedNode.position = [
previouslyAddedNode.position[0] +
@ -3775,6 +3772,9 @@ export default defineComponent({
NodeViewUtils.GRID_SIZE,
previouslyAddedNode.position[1],
];
await this.$nextTick();
this.connectTwoNodes(previouslyAddedNode.name, 0, lastAddedNode.name, 0);
actionWatcher();
});
}