From 77f5567d3a678ab884e9ded5eba3ae2b25dab613 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Thu, 22 Jun 2023 11:41:23 +0100 Subject: [PATCH] fix duplicate loop block issue --- .../AutomationBuilder/FlowChart/FlowItem.svelte | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte index 092138170f..7a02433411 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte @@ -78,9 +78,6 @@ } async function removeLooping() { - let loopBlock = $selectedAutomation?.definition.steps.find( - x => x.blockToLoop === block.id - ) try { await automationStore.actions.deleteAutomationBlock(loopBlock) } catch (error) { @@ -89,10 +86,6 @@ } async function deleteStep() { - let loopBlock = $selectedAutomation?.definition.steps.find( - x => x.blockToLoop === block.id - ) - try { if (loopBlock) { await automationStore.actions.deleteAutomationBlock(loopBlock) @@ -168,8 +161,8 @@ $automationStore.blockDefinitions.ACTION.LOOP.schema.inputs .properties )} - block={loopBlock} {webhookModal} + block={loopBlock} /> @@ -191,7 +184,7 @@ {#if !isTrigger}
- {#if block?.features?.[Features.LOOPING] || !block.features} + {#if !loopBlock && (block?.features?.[Features.LOOPING] || !block.features)} addLooping()} icon="Reuse"> Add Looping