From 53c1198f0ccfad1c1ea95ab87be7244b8a61b2a6 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 23 Oct 2024 10:32:57 -0700 Subject: no more slow fee rate --- src/routes/+layout.server.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/routes/+layout.server.ts') diff --git a/src/routes/+layout.server.ts b/src/routes/+layout.server.ts index a18ba506..b4022e69 100644 --- a/src/routes/+layout.server.ts +++ b/src/routes/+layout.server.ts @@ -3,7 +3,7 @@ import { loadTranslations, locales, } from "$lib/translations/index"; -import { auth, get } from "$lib/utils"; +import { auth, get, sleep } from "$lib/utils"; export const load = async ({ cookies, request, url }) => { const { host, pathname } = url; @@ -12,7 +12,10 @@ export const load = async ({ cookies, request, url }) => { if (token) { try { user = await get("/me", auth(cookies)); - } catch (e) {} + } catch (e) { + if (e.message.startsWith("Rate")) await sleep(3000); + user = await get("/me", auth(cookies)); + } } // Try to get the locale from cookie -- cgit v1.2.3