From 9740ebe67901f6e0792f406857d2065edcd89119 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Mon, 22 Aug 2022 11:14:51 +0200 Subject: [PATCH] Fix step addition --- client/src/components/Workflow/Editor/Index.vue | 5 ++--- client/src/components/Workflow/Editor/WorkflowConnection.vue | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/client/src/components/Workflow/Editor/Index.vue b/client/src/components/Workflow/Editor/Index.vue index 5c6af97a766..8817e61e56a 100644 --- a/client/src/components/Workflow/Editor/Index.vue +++ b/client/src/components/Workflow/Editor/Index.vue @@ -249,7 +249,6 @@ export default { parameters: null, steps: {}, hasChanges: false, - nodeIndex: 0, nodes: {}, datatypesMapper: null, datatypes: [], @@ -443,7 +442,7 @@ export default { this.onNavigate(editUrl); }, async onClone(node) { - const newId = this.nodeIndex++; + const newId = Object.keys(this.steps).length; const stepCopy = JSON.parse(JSON.stringify(node.step)); await Vue.set(this.steps, newId, { ...stepCopy, @@ -628,7 +627,7 @@ export default { this.isCanvas = true; return; } - Vue.set(this.steps, this.nodeIndex++, { + Vue.set(this.steps, Object.keys(this.steps).length, { name: name, content_id: contentId, type: type, diff --git a/client/src/components/Workflow/Editor/WorkflowConnection.vue b/client/src/components/Workflow/Editor/WorkflowConnection.vue index ae368b354ad..63e31e002d6 100644 --- a/client/src/components/Workflow/Editor/WorkflowConnection.vue +++ b/client/src/components/Workflow/Editor/WorkflowConnection.vue @@ -1,5 +1,5 @@