Fix bug with deleting automations

This commit is contained in:
Andrew Kingston 2020-10-02 19:09:44 +01:00
parent 4d8e4061b3
commit 123b4394c3
1 changed files with 2 additions and 1 deletions

View File

@ -13,6 +13,7 @@
$: allowDeleteBlock = $: allowDeleteBlock =
$automationStore.selectedBlock?.type !== "TRIGGER" || $automationStore.selectedBlock?.type !== "TRIGGER" ||
!automation?.definition?.steps?.length !automation?.definition?.steps?.length
$: name = automation?.name ?? ""
function deleteAutomationBlock() { function deleteAutomationBlock() {
automationStore.actions.deleteAutomationBlock( automationStore.actions.deleteAutomationBlock(
@ -101,7 +102,7 @@
<ConfirmDialog <ConfirmDialog
bind:this={confirmDeleteDialog} bind:this={confirmDeleteDialog}
title="Confirm Delete" title="Confirm Delete"
body={`Are you sure you wish to delete the automation '${automation.name}'?`} body={`Are you sure you wish to delete the automation '${name}'?`}
okText="Delete Automation" okText="Delete Automation"
onOk={deleteAutomation} /> onOk={deleteAutomation} />