Fix clock flickering from duplicate setInterval timers

app.js and nav.html both started 1-second intervals updating the same
#headerUtcTime element. Even though both used InterceptTime, their
slightly different timing caused visible text flicker.

Fix: app.js now sets window._navClockStarted before starting its
interval, so nav.html's guard condition skips its duplicate. Also
register InterceptTime.onChange listener in app.js for instant updates.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
mitchross
2026-03-26 00:29:06 -04:00
parent f4672cf0c7
commit 6de443e833
+4
View File
@@ -465,7 +465,11 @@ function initApp() {
// Start clock and init time settings
initTimeSettings();
updateHeaderClock();
window._navClockStarted = true; // Prevent nav.html from starting a duplicate interval
setInterval(updateHeaderClock, 1000);
if (typeof InterceptTime !== 'undefined' && InterceptTime.onChange) {
InterceptTime.onChange(updateHeaderClock);
}
// Load bias-T setting
loadBiasTSetting();