From af9b9b692124464a5a7f3e93ba76e93e319a252a Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Wed, 4 May 2022 10:24:28 +0100 Subject: [PATCH] Some foreach block fixes --- .../FlowChart/FlowItem.svelte | 16 ++++++++--- packages/server/src/threads/automation.js | 27 ++++++++++--------- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte index 0829b85a90..532e0ff068 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte @@ -53,6 +53,18 @@ x => x.blockToLoop === block.id ) + async function removeLooping() { + loopingSelected = false + let loopBlock = + $automationStore.selectedAutomation?.automation.definition.steps.find( + x => x.blockToLoop === block.id + ) + automationStore.actions.deleteAutomationBlock(loopBlock) + await automationStore.actions.save( + $automationStore.selectedAutomation?.automation + ) + } + async function deleteStep() { let loopBlock = $automationStore.selectedAutomation?.automation.definition.steps.find( @@ -151,9 +163,7 @@ {#if !showLooping}
-
deleteStep()}> - -
+ removeLooping()} icon="DeleteOutline" />