From db1aecd3d8d3dba40973ac842dd40aeab6f9fd2e Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 19 Jan 2024 15:28:54 +1000 Subject: [PATCH] Ignore congrats fetch errors The congrats page fetches data once a minute, and onRefreshTimer() reloads the page once every 10 minutes. If a data fetch is in flight when the page reload happens, it can cause a 'failed to fetch' error to occur. Closes #2895 --- ts/congrats/index.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ts/congrats/index.ts b/ts/congrats/index.ts index a87f1acef..c704cad6d 100644 --- a/ts/congrats/index.ts +++ b/ts/congrats/index.ts @@ -26,8 +26,12 @@ export async function setupCongrats(): Promise { // refresh automatically if a custom area not provided if (!customMountPoint) { setInterval(async () => { - const info = await congratsInfo({}); - page.$set({ info }); + try { + const info = await congratsInfo({}); + page.$set({ info }); + } catch { + console.log("congrats fetch failed"); + } }, 60000); }