diff options
| author | Adam Soltys <[email protected]> | 2023-12-01 20:04:13 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-12-01 20:04:13 -0800 |
| commit | 216a600224fde22ce76b367557a02094ec693886 (patch) | |
| tree | d1189bbaa39db204633523132a7d4767b952717d /src/routes/+layout.server.js | |
| parent | 7d9bc1f54dfd04172e8d6d43ebc2efd6f407e833 (diff) | |
| download | coinos-ui-216a600224fde22ce76b367557a02094ec693886.tar.gz coinos-ui-216a600224fde22ce76b367557a02094ec693886.zip | |
prettier
Diffstat (limited to 'src/routes/+layout.server.js')
| -rw-r--r-- | src/routes/+layout.server.js | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/routes/+layout.server.js b/src/routes/+layout.server.js index 60a2f6c6..5273d372 100644 --- a/src/routes/+layout.server.js +++ b/src/routes/+layout.server.js @@ -1,17 +1,17 @@ import { auth, get } from "$lib/utils"; -import { loadTranslations, locale } from '$lib/translations'; +import { loadTranslations, locale } from "$lib/translations"; export const load = async ({ cookies, url }) => { - let user; - let token = cookies.get('token'); - if (token) { - try { - user = await get('/me', auth(cookies)); - } catch (e) {} - } + let user; + let token = cookies.get("token"); + if (token) { + try { + user = await get("/me", auth(cookies)); + } catch (e) {} + } - const { host, pathname } = url; - const defaultLocale = user?.language || 'en'; // get from cookie, user session, ... - const initLocale = locale.get() || defaultLocale; // set default if no locale already set - await loadTranslations(initLocale, pathname); // keep this just before the `return` - return { host, pathname }; + const { host, pathname } = url; + const defaultLocale = user?.language || "en"; // get from cookie, user session, ... + const initLocale = locale.get() || defaultLocale; // set default if no locale already set + await loadTranslations(initLocale, pathname); // keep this just before the `return` + return { host, pathname }; }; |
