From 587b77e70bbe6e7d32ac6a05e73c0fb314cab32f Mon Sep 17 00:00:00 2001 From: Alex Tran Date: Sat, 11 Jun 2022 19:58:16 -0500 Subject: [PATCH] Fixex announcement web not close after acknowledgement --- web/src/lib/components/shared/announcement-box.svelte | 4 +++- web/src/routes/__layout.svelte | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/web/src/lib/components/shared/announcement-box.svelte b/web/src/lib/components/shared/announcement-box.svelte index e0096daeb8..73a25a128a 100644 --- a/web/src/lib/components/shared/announcement-box.svelte +++ b/web/src/lib/components/shared/announcement-box.svelte @@ -7,10 +7,12 @@ export let localVersion: string; export let remoteVersion: string; + const dispatch = createEventDispatcher(); + const acknowledgeClickHandler = () => { localStorage.setItem('appVersion', remoteVersion); - goto($page.url.pathname); + dispatch('close'); }; diff --git a/web/src/routes/__layout.svelte b/web/src/routes/__layout.svelte index d81a21e704..6245af9503 100644 --- a/web/src/routes/__layout.svelte +++ b/web/src/routes/__layout.svelte @@ -7,6 +7,7 @@ if (browser) { const { shouldShowAnnouncement, localVersion, remoteVersion } = await checkAppVersion(); + console.log('Recheck'); return { props: { url, shouldShowAnnouncement, localVersion, remoteVersion } }; } else { return { @@ -38,7 +39,7 @@ {#if shouldShowAnnouncement} - + (shouldShowAnnouncement = false)} /> {/if} {/key}