aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-11-16 22:17:40 -0800
committerAdam Soltys <[email protected]>2024-11-16 22:17:40 -0800
commitcb5ab0167d8fe0c673aeb5f90dfd610b8194e227 (patch)
treec1fa57adb74ce24799654b9b41aef98f7735cf30 /src
parenta2a574549a10ba405e5226852cd640ab8ed78e7f (diff)
downloadcoinos-ui-cb5ab0167d8fe0c673aeb5f90dfd610b8194e227.tar.gz
coinos-ui-cb5ab0167d8fe0c673aeb5f90dfd610b8194e227.zip
avoid reload
Diffstat (limited to 'src')
-rw-r--r--src/routes/+layout.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/routes/+layout.ts b/src/routes/+layout.ts
index 5f480c5a..b40aff70 100644
--- a/src/routes/+layout.ts
+++ b/src/routes/+layout.ts
@@ -1,4 +1,5 @@
import { browser } from "$app/environment";
+import { theme as themeStore } from "$lib/store";
import { addTranslations, setLocale, setRoute } from "$lib/translations/index";
import { addIcon } from "iconify-icon";
import cookies from "js-cookie";
@@ -25,7 +26,7 @@ export const load = async ({ data }) => {
expires.setSeconds(expires.getSeconds() + 21000000);
cookies.set("theme", theme, { path: "/", expires });
- if (theme === "dark") location.reload();
+ if (theme === "dark") setTimeout(() => themeStore.set(theme), 100);
}
}
};