Skip to content

Commit

Permalink
🐛 Fixing pushing nodes downstream when inserting new node
Browse files Browse the repository at this point in the history
  • Loading branch information
MiloradFilipovic committed Nov 7, 2022
1 parent d66f9d2 commit c761186
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/editor-ui/src/stores/workflows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
return node.name === updateInformation.name;
});

if (node === undefined || node === null) {
if (node === undefined || node === null || !updateInformation.key) {
throw new Error(`Node with the name "${updateInformation.name}" could not be found to set parameter.`);
}

Expand Down
3 changes: 2 additions & 1 deletion packages/editor-ui/src/views/NodeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1161,14 +1161,15 @@ export default mixins(
const childNodes = workflow.getChildNodes(sourceNodeName);
for (const nodeName of childNodes) {
const node = this.workflowsStore.nodesByName[nodeName] as INodeUi;
if (node.position[0] < sourceNode.position[0]) {
continue;
}
const updateInformation: INodeUpdatePropertiesInformation = {
name: nodeName,
properties: {
position: { position: [node.position[0] + margin, node.position[1]] },
position: [node.position[0] + margin, node.position[1]],
},
};
Expand Down

0 comments on commit c761186

Please sign in to comment.