21 lines
920 B
JavaScript
21 lines
920 B
JavaScript
let historyResizeTimer;
|
|
window.addEventListener('resize', () => { if (app.currentView === 'history') { clearTimeout(historyResizeTimer); historyResizeTimer=setTimeout(drawCurrentChartIfVisible,120); } });
|
|
window.matchMedia('(prefers-color-scheme: light)').addEventListener('change', () => { if (app.theme === 'system') applyTheme(); });
|
|
if ('serviceWorker' in navigator) window.addEventListener('load', () => navigator.serviceWorker.register(withBase('/sw.js')).catch(()=>{}));
|
|
|
|
async function startApplication() {
|
|
observeTopbarHeight();
|
|
applyTheme();
|
|
await loadLanguages();
|
|
applyTranslations();
|
|
setupFormUx();
|
|
updateZoneSensorFields();
|
|
updateSchedulePresetField();
|
|
await loadBootstrap();
|
|
initRouter();
|
|
}
|
|
|
|
setInterval(updateLocalThermostatCountdowns, 1000);
|
|
setInterval(updateTemporaryThermostatCountdowns, 1000);
|
|
startApplication().catch(error => console.error('Application startup failed:', error));
|