mirror of
https://github.com/smittix/intercept.git
synced 2026-06-08 14:11:54 -07:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user