From f02ba99a60ed0494b8ee87c563788a3af2bdf03c Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Thu, 18 Apr 2024 00:25:43 -0700
Subject: fix(layout): check if browser

---
 src/routes/+layout.svelte | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'src/routes/+layout.svelte')

diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index 0b1e81dc..9416e1d4 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -107,7 +107,9 @@
 			});
 	});
 
-	onDestroy(() => window.removeEventListener('scroll', handleScroll));
+	onDestroy(() => {
+		if (browser) window.removeEventListener('scroll', handleScroll);
+	});
 
 	$: {
 		if ((data.url === '/' || data.url === '/completed' || data.url === '/schedule') && !$subsPlease)
-- 
cgit v1.2.3

