feat: improve error handling

This commit is contained in:
Xyphyn committed 2023-08-03 12:07:57 -07:00
1 parent 4b6878ffac
commit e34cace14f
8 files changed
+39 -31

No files matched your search

+15 -14
View File
@@ -49,24 +49,25 @@
{/if}
<p class="text-sm">{toast.content}</p>
</div>
<div class="ml-auto" />
{#if toast.action}
<div class="ml-auto flex items-center gap-2 m-2">
{#if toast.action}
<button
on:click={() => {
toast.action?.()
toasts.update((toasts) => toasts.filter((t) => t.id != toast.id))
}}
class="rounded-lg w-max transition-colors hover:bg-black/20 hover:dark:bg-white/20 p-2"
>
<Icon src={Check} size="16" mini />
</button>
{/if}
<button
on:click={() => {
toast.action?.()
toasts.update((toasts) => toasts.filter((t) => t.id != toast.id))
}}
class="rounded-lg w-max transition-colors hover:bg-black/20 hover:dark:bg-white/20 p-2 m-2"
class="rounded-lg w-max transition-colors hover:bg-black/20 hover:dark:bg-white/20 p-2"
>
<Icon src={Check} size="16" mini />
<Icon src={XMark} size="16" mini />
</button>
{/if}
<button
on:click={() => {
toasts.update((toasts) => toasts.filter((t) => t.id != toast.id))
}}
class="rounded-lg w-max transition-colors hover:bg-black/20 hover:dark:bg-white/20 p-2 m-2"
>
<Icon src={XMark} size="16" mini />
</button>
</div>
</div>