diff options
| author | Adam Soltys <[email protected]> | 2024-10-23 10:32:57 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-10-23 10:32:57 -0700 |
| commit | 53c1198f0ccfad1c1ea95ab87be7244b8a61b2a6 (patch) | |
| tree | 05dfd147b48d6a95f00beb01a128e187eb05cc18 /src/routes/+layout.server.ts | |
| parent | b21b2c01b0294427fd799249a4670415c256df3f (diff) | |
| download | coinos-ui-53c1198f0ccfad1c1ea95ab87be7244b8a61b2a6.tar.gz coinos-ui-53c1198f0ccfad1c1ea95ab87be7244b8a61b2a6.zip | |
no more slow fee rate
Diffstat (limited to 'src/routes/+layout.server.ts')
| -rw-r--r-- | src/routes/+layout.server.ts | 7 |
1 files changed, 5 insertions, 2 deletions
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 |
