From 3b10a1f47fd5838fe3b94c19673a52610b88cf1e Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.net>
Date: Sun, 1 Mar 2026 14:20:08 -0800
Subject: perf: optimise list hot paths and shared timers

---
 src/routes/updates/+page.svelte | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'src/routes/updates/+page.svelte')

diff --git a/src/routes/updates/+page.svelte b/src/routes/updates/+page.svelte
index 22fcd3a7..a08e4966 100644
--- a/src/routes/updates/+page.svelte
+++ b/src/routes/updates/+page.svelte
@@ -21,10 +21,10 @@
   let mangaEndTime: number;
   let novelEndTime: number;
   let directLink = browser ? new URLSearchParams(window.location.search).has('d') : false;
-  let heightObserver: ReturnType<typeof setInterval>;
+  let removeHeightObserver: (() => void) | undefined;
 
   onMount(async () => {
-    heightObserver = setInterval(() => createHeightObserver(false), 0);
+    removeHeightObserver = createHeightObserver(false);
 
     startTime = performance.now();
     novelFeed = await (await fetch(root('/api/updates/all-novels'))).json();
@@ -34,7 +34,7 @@
     mangaEndTime = performance.now() - startTime;
   });
 
-  onDestroy(() => clearInterval(heightObserver));
+  onDestroy(() => removeHeightObserver?.());
 
   const reformatChapter = (title: string) =>
     title
-- 
cgit v1.2.3

