From bd7c91b1bd7e1ecf87eb620758454a12e9beea52 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Fri, 10 Mar 2023 14:40:26 +0000 Subject: [PATCH] Fix automation saving issue --- .../automation/SetupPanel/AutomationBlockSetup.svelte | 3 +-- packages/server/src/automations/automationUtils.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte index f47fb8a086..7ede3757ce 100644 --- a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte +++ b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte @@ -50,7 +50,7 @@ $: tempFilters = filters $: stepId = block.stepId $: bindings = getAvailableBindings(block, $selectedAutomation?.definition) - $: getInputData(testData, block.inputs) + $: getInputData(testData, cloneDeep(block.inputs)) $: tableId = inputData ? inputData.tableId : null $: table = tableId ? $tables.list.find(table => table._id === inputData.tableId) @@ -79,7 +79,6 @@ searchableSchema: true, }).schema } - try { if (isTestModal) { let newTestData = { schema } diff --git a/packages/server/src/automations/automationUtils.ts b/packages/server/src/automations/automationUtils.ts index 254d9c624b..8de529834f 100644 --- a/packages/server/src/automations/automationUtils.ts +++ b/packages/server/src/automations/automationUtils.ts @@ -107,7 +107,7 @@ export function substituteLoopStep(hbsString: string, substitute: string) { let pointer = 0, openPointer = 0, closedPointer = 0 - while (pointer < hbsString.length) { + while (pointer < hbsString?.length) { openPointer = hbsString.indexOf(open, pointer) closedPointer = hbsString.indexOf(closed, pointer) + 2 if (openPointer < 0 || closedPointer < 0) {