Check whether flow is defined before rendering the preview button (#337)

This commit is contained in:
Faton Ramadani
2022-08-05 09:11:55 +02:00
committed by GitHub
parent 7755e6fea9
commit c6c0837c9b
+12 -13
View File
@@ -196,24 +196,23 @@
bind:schema={$flowStore.schema}
/>
{/if}
<Button
disabled={pathIsEmpty($flowStore.path)}
size="lg"
pill
on:click={() => (previewOpen = !previewOpen)}
class={`blue-button fixed bottom-10 right-10 ${previewOpen ? 'hidden' : ''}`}
>
Preview flow
{pathIsEmpty($flowStore.path) ? '(pick a name first!)' : ''}
<Icon data={faPlay} class="ml-2" />
</Button>
{:else}
<p>Loading</p>
{/if}
</div>
<Button
disabled={pathIsEmpty($flowStore.path)}
size="lg"
pill
on:click={() => (previewOpen = !previewOpen)}
class={`blue-button fixed bottom-10 right-10 ${previewOpen ? 'hidden' : ''}`}
>
Preview flow
{pathIsEmpty($flowStore.path) ? '(pick a name first!)' : ''}
<Icon data={faPlay} class="ml-2" />
</Button>
<div class={`relative h-screen w-1/3 ${previewOpen ? '' : 'hidden'}`}>
<div class="absolute top-0 h-full">
<div class="fixed border-l-2 right-0 h-screen w-1/3">