Skip to content

Commit

Permalink
fix: update info toast dismiss issue
Browse files Browse the repository at this point in the history
  • Loading branch information
tjbck committed Oct 7, 2024
1 parent 6e8e045 commit ed9fbe1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/lib/components/layout/UpdateInfoToast.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@
>
</div>

<div class=" flex-shrink-0 pl-2">
<div class=" flex-shrink-0 pr-1">
<button
class=" hover:text-blue-900 dark:hover:text-blue-300 transition"
on:click={() => {
console.log('closeToast');
localStorage.setItem('dismissedUpdateToast', Date.now().toString());
dispatch('closeToast');
dispatch('close');
}}
>
<XMark />
Expand Down
8 changes: 7 additions & 1 deletion src/routes/(app)/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,13 @@

{#if version && compareVersion(version.latest, version.current)}
<div class=" absolute bottom-8 right-8 z-50" in:fade={{ duration: 100 }}>
<UpdateInfoToast {version} />
<UpdateInfoToast
{version}
on:close={() => {
localStorage.setItem('dismissedUpdateToast', Date.now().toString());
version = null;
}}
/>
</div>
{/if}

Expand Down

0 comments on commit ed9fbe1

Please sign in to comment.