fix reactivity bug with synchronous param

This commit is contained in:
Peter Clement 2023-05-26 13:18:08 +01:00
parent 9dc354c28b
commit 221d03c153
1 changed files with 7 additions and 13 deletions

View File

@ -7,8 +7,6 @@
export let parameters = {}
export let bindings = []
let synchronous = parameters.synchronous
const AUTOMATION_STATUS = {
NEW: "new",
EXISTING: "existing",
@ -20,14 +18,11 @@
$: {
if (automationStatus === AUTOMATION_STATUS.NEW) {
synchronous = false
}
if (automationStatus === AUTOMATION_STATUS.EXISTING) {
synchronous = automations.find(
automation => automation._id === parameters.automationId
).synchronous
parameters.synchronous = false
}
parameters.synchronous = automations.find(
automation => automation._id === parameters.automationId
)?.synchronous
}
$: automations = $automationStore.automations
.filter(a => a.definition.trigger?.stepId === TriggerStepID.APP)
@ -80,11 +75,10 @@
const onChange = value => {
let automationId = value.detail
synchronous = automations.find(
parameters.synchronous = automations.find(
automation => automation._id === automationId
).synchronous
)?.synchronous
parameters.automationId = automationId
parameters.synchronous = synchronous
}
</script>
@ -128,7 +122,7 @@
/>
{/if}
{#if synchronous}
{#if parameters.synchronous}
<Label small />
<div class="synchronous-info">