From 2cd6b1c3b79201fbed6fc93161b999300ab19470 Mon Sep 17 00:00:00 2001 From: Abdo Date: Sun, 24 Nov 2024 13:52:56 +0300 Subject: [PATCH] Fix congrats screen not refreshing (#3594) --- ts/routes/congrats/CongratsPage.svelte | 15 +++++++++++++++ ts/routes/congrats/index.ts | 14 +------------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/ts/routes/congrats/CongratsPage.svelte b/ts/routes/congrats/CongratsPage.svelte index bd05e10d9..cc4eee861 100644 --- a/ts/routes/congrats/CongratsPage.svelte +++ b/ts/routes/congrats/CongratsPage.svelte @@ -4,6 +4,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html --> diff --git a/ts/routes/congrats/index.ts b/ts/routes/congrats/index.ts index 2e2b28d75..52fc74a3d 100644 --- a/ts/routes/congrats/index.ts +++ b/ts/routes/congrats/index.ts @@ -20,21 +20,9 @@ export async function setupCongrats(): Promise { const page = new CongratsPage({ // use #congrats if it exists, otherwise entire body target: customMountPoint ?? document.body, - props: { info }, + props: { info, refreshPeriodically: !customMountPoint }, }); - // refresh automatically if a custom area not provided - if (!customMountPoint) { - setInterval(async () => { - try { - const info = await congratsInfo({}); - page.$set({ info }); - } catch { - console.log("congrats fetch failed"); - } - }, 60000); - } - return page; }