From 3d1c3705c3ff3877236a6917dda2ec4919dde95c Mon Sep 17 00:00:00 2001 From: not-nullptr Date: Fri, 15 Nov 2024 14:13:13 +0000 Subject: [PATCH] fix: urgent! sooo urgent!! --- src/lib/store/index.svelte.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/store/index.svelte.ts b/src/lib/store/index.svelte.ts index 61f665d..cc12fa8 100644 --- a/src/lib/store/index.svelte.ts +++ b/src/lib/store/index.svelte.ts @@ -1,3 +1,4 @@ +import { browser } from "$app/environment"; import { log } from "$lib/logger"; import { VertFile } from "$lib/types"; import JSCookie from "js-cookie"; @@ -16,9 +17,10 @@ class Theme { expires: 2147483647, }); log(["theme"], `set to ${this.dark ? "dark" : "light"}`); - window.plausible("Theme set", { - props: { theme: theme.dark ? "dark" : "light" }, - }); + if (browser) + window.plausible("Theme set", { + props: { theme: theme.dark ? "dark" : "light" }, + }); }; }