From b06ffa2329ff6e8c3713e9ac2240d901751f7c4d Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Thu, 12 Mar 2026 17:21:38 -0400 Subject: [PATCH] refactor(admin): remove DOMContentLoaded listener for watch status initialization - Remove document.addEventListener("DOMContentLoaded") wrapper for loadWatchStatus() - Simplify initialization - loadWatchStatus() is now called via Alpine.js x-init - Reduces 4 lines, keeps same functionality The loadWatchStatus() function is now triggered by template's x-init directive instead of a global DOMContentLoaded listener, ensuring it only runs on the admin page where it's actually needed. --- web/src/admin.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/web/src/admin.ts b/web/src/admin.ts index cd626e5..e79b2cc 100644 --- a/web/src/admin.ts +++ b/web/src/admin.ts @@ -328,10 +328,6 @@ async function loadWatchStatus(): Promise { } } -document.addEventListener("DOMContentLoaded", function () { - loadWatchStatus(); -}); - let scanPollInterval: ReturnType | undefined = undefined; function stopScanStatusPolling(): void {