Removed unused variable and fixes blockref references

This commit is contained in:
Dean 2024-10-13 23:06:26 +01:00
parent 9cfc3d499d
commit b999c1ac80
2 changed files with 3 additions and 5 deletions

View File

@ -69,7 +69,6 @@
// Stop unnecessary rendering // Stop unnecessary rendering
const memoBlock = memo(block) const memoBlock = memo(block)
const memoEnvVariables = memo($environment.variables)
const rowTriggers = [ const rowTriggers = [
TriggerStepID.ROW_UPDATED, TriggerStepID.ROW_UPDATED,
@ -91,7 +90,6 @@
let insertAtPos, getCaretPosition let insertAtPos, getCaretPosition
let stepLayouts = {} let stepLayouts = {}
$: memoEnvVariables.set($environment.variables)
$: memoBlock.set(block) $: memoBlock.set(block)
$: filters = lookForFilters(schemaProperties) $: filters = lookForFilters(schemaProperties)

View File

@ -192,7 +192,7 @@ const automationActions = store => ({
* @returns {Array<Object>} - all bindings on the path to this step * @returns {Array<Object>} - all bindings on the path to this step
*/ */
getPathBindings: id => { getPathBindings: id => {
const block = get(store).blocks[id] const block = get(selectedAutomation).blockRefs[id]
const bindings = store.actions.getAvailableBindings( const bindings = store.actions.getAvailableBindings(
block, block,
get(selectedAutomation).data get(selectedAutomation).data
@ -266,7 +266,7 @@ const automationActions = store => ({
} }
// Registered blocks // Registered blocks
const blocks = get(store).blocks const blocks = get(selectedAutomation).blockRefs
// Get all preceeding steps, including the trigger // Get all preceeding steps, including the trigger
// Filter out the target step as we don't want to include itself // Filter out the target step as we don't want to include itself
@ -638,7 +638,7 @@ const automationActions = store => ({
newAutomation = cloneDeep(automation) newAutomation = cloneDeep(automation)
newAutomation.definition.trigger = block newAutomation.definition.trigger = block
} else { } else {
const pathToStep = get(automationStore).blocks[block.id].pathTo const pathToStep = get(selectedAutomation).blockRefs[block.id].pathTo
newAutomation = automationStore.actions.updateStep( newAutomation = automationStore.actions.updateStep(
pathToStep, pathToStep,
automation, automation,