From 5702eb464b845d0bae71988ae23bf3a4f2591cac Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Mon, 11 Oct 2021 11:10:26 +0100 Subject: [PATCH] fix issue where automation block was not being added in the correct order --- .../AutomationBuilder/FlowChart/ActionModal.svelte | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte index acb945a96a..b076a8da86 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte @@ -4,10 +4,11 @@ import { externalActions } from "./ExternalActions" export let blockIdx + export let blockComplete + let selectedAction let actionVal let actions = Object.entries($automationStore.blockDefinitions.ACTION) - export let blockComplete const external = actions.reduce((acc, elm) => { const [k, v] = elm @@ -36,10 +37,9 @@ actionVal.stepId, actionVal ) - automationStore.actions.addBlockToAutomation(newBlock) + automationStore.actions.addBlockToAutomation(newBlock, blockIdx + 1) await automationStore.actions.save( - $automationStore.selectedAutomation?.automation, - blockIdx + $automationStore.selectedAutomation?.automation ) }