Browse Source

fix issue where automation block was not being added in the correct order

master
Peter Clement 5 years ago
parent
commit
5702eb464b
  1. 8
      packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte

8
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
)
}
</script>

Loading…
Cancel
Save