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.
This commit is contained in:
@@ -328,10 +328,6 @@ async function loadWatchStatus(): Promise<void> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", function () {
|
|
||||||
loadWatchStatus();
|
|
||||||
});
|
|
||||||
|
|
||||||
let scanPollInterval: ReturnType<typeof setInterval> | undefined = undefined;
|
let scanPollInterval: ReturnType<typeof setInterval> | undefined = undefined;
|
||||||
|
|
||||||
function stopScanStatusPolling(): void {
|
function stopScanStatusPolling(): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user