diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte index ccb1369c57..9899c454fc 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte @@ -17,12 +17,12 @@ export let blockIdx export let lastStep + export let modal let syncAutomationsEnabled = $licensing.syncAutomationsEnabled let triggerAutomationRunEnabled = $licensing.triggerAutomationRunEnabled let collectBlockAllowedSteps = [TriggerStepID.APP, TriggerStepID.WEBHOOK] let selectedAction - let actionVal let actions = Object.entries($automationStore.blockDefinitions.ACTION) let lockedFeatures = [ ActionStepID.COLLECT, @@ -91,19 +91,17 @@ return acc }, {}) - const selectAction = action => { - actionVal = action + const selectAction = async action => { selectedAction = action.name - } - async function addBlockToAutomation() { try { const newBlock = automationStore.actions.constructBlock( "ACTION", - actionVal.stepId, - actionVal + action.stepId, + action ) await automationStore.actions.addBlockToAutomation(newBlock, blockIdx + 1) + modal.hide() } catch (error) { notifications.error("Error saving automation") } @@ -114,10 +112,10 @@ Apps diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte index 48b630cb62..811909845a 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte @@ -206,7 +206,7 @@ {/if} - +