1
0
Fork 0
mirror of synced 2024-09-21 03:43:21 +12:00

Fix delete

This commit is contained in:
Mel O'Hagan 2022-08-25 19:07:13 +01:00
parent f2881fc714
commit 8a75b0a26d

View file

@ -67,7 +67,7 @@
{/if} {/if}
{:else if schema.type === QueryTypes.FLOW} {:else if schema.type === QueryTypes.FLOW}
<br /> <br />
{#if query.fields.steps?.length == 0} {#if (query.fields.steps?.length ?? 0) === 0}
<div class="controls"> <div class="controls">
<Button <Button
secondary secondary
@ -93,9 +93,8 @@
Stage {index + 1} Stage {index + 1}
<ActionButton <ActionButton
on:click={() => { on:click={() => {
query.fields.steps = [ query.fields.steps.splice(index, 1)
...query.fields.steps.splice(index, 1), query.fields.steps = query.fields.steps
]
}} }}
icon="DeleteOutline" icon="DeleteOutline"
/> />
@ -109,14 +108,18 @@
query.fields.steps[index].key = detail query.fields.steps[index].key = detail
}} }}
/> />
<Editor {#key query.fields.steps.length}
editorHeight={height / 2} <Editor
mode="json" editorHeight={height / 2}
value={step.value} mode="json"
on:change={({ detail }) => { value={typeof step.value === "string"
query.fields.steps[index].value = detail ? step.value
}} : step.value.value}
/> on:change={({ detail }) => {
query.fields.steps[index].value = detail
}}
/>
{/key}
</div> </div>
</div> </div>
</Layout> </Layout>