From b999c1ac80a14fc37f1685a8343690a880704fce Mon Sep 17 00:00:00 2001 From: Dean Date: Sun, 13 Oct 2024 23:06:26 +0100 Subject: [PATCH] Removed unused variable and fixes blockref references --- .../automation/SetupPanel/AutomationBlockSetup.svelte | 2 -- packages/builder/src/stores/builder/automations.js | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte index 60997896f9..0c83e2520e 100644 --- a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte +++ b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte @@ -69,7 +69,6 @@ // Stop unnecessary rendering const memoBlock = memo(block) - const memoEnvVariables = memo($environment.variables) const rowTriggers = [ TriggerStepID.ROW_UPDATED, @@ -91,7 +90,6 @@ let insertAtPos, getCaretPosition let stepLayouts = {} - $: memoEnvVariables.set($environment.variables) $: memoBlock.set(block) $: filters = lookForFilters(schemaProperties) diff --git a/packages/builder/src/stores/builder/automations.js b/packages/builder/src/stores/builder/automations.js index 133cb335a1..78328f9a38 100644 --- a/packages/builder/src/stores/builder/automations.js +++ b/packages/builder/src/stores/builder/automations.js @@ -192,7 +192,7 @@ const automationActions = store => ({ * @returns {Array} - all bindings on the path to this step */ getPathBindings: id => { - const block = get(store).blocks[id] + const block = get(selectedAutomation).blockRefs[id] const bindings = store.actions.getAvailableBindings( block, get(selectedAutomation).data @@ -266,7 +266,7 @@ const automationActions = store => ({ } // Registered blocks - const blocks = get(store).blocks + const blocks = get(selectedAutomation).blockRefs // Get all preceeding steps, including the trigger // Filter out the target step as we don't want to include itself @@ -638,7 +638,7 @@ const automationActions = store => ({ newAutomation = cloneDeep(automation) newAutomation.definition.trigger = block } else { - const pathToStep = get(automationStore).blocks[block.id].pathTo + const pathToStep = get(selectedAutomation).blockRefs[block.id].pathTo newAutomation = automationStore.actions.updateStep( pathToStep, automation,