web/DialogHolder: fix typescript error, add a note

This commit is contained in:
wukko 2024-07-27 15:28:02 +06:00
parent 26eaac5742
commit b8eb708748
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2

View file

@ -8,16 +8,18 @@
$: backdropVisible = $dialogs.length > 0;
</script>
<!--
this is the cleanest way of passing props without typescript throwing a fit.
more info here: https://github.com/microsoft/TypeScript/issues/46680
-->
<div id="dialog-holder">
{#each $dialogs as dialog}
{@const { type, ...data } = dialog}
{#if type === "small"}
<SmallDialog {...data} />
{:else if type === "picker"}
<PickerDialog {...data} />
{:else if type === "saving"}
<SavingDialog {...data} />
{#if dialog.type === "small"}
<SmallDialog {...dialog} />
{:else if dialog.type === "picker"}
<PickerDialog {...dialog} />
{:else if dialog.type === "saving"}
<SavingDialog {...dialog} />
{/if}
{/each}
<div id="dialog-backdrop" class:visible={backdropVisible}></div>