MCPcopy Create free account
hub / github.com/BruceDevices/firmware / taskReloader

Function taskReloader

embedded_resources/web_interface/index.js:549–564  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

547const eConfigAutoReload = $("#navigator-auto-reload");
548let AUTO_RELOAD_SCREEN = null;
549async function taskReloader() {
550 let timer = parseInt(eConfigAutoReload.value);
551 let navigatorOpen = $(".dialog.navigator:not(.hidden)");
552 if (timer <= 0 || !navigatorOpen) {
553 if (AUTO_RELOAD_SCREEN) {
554 clearTimeout(AUTO_RELOAD_SCREEN);
555 AUTO_RELOAD_SCREEN = null;
556 }
557
558 return;
559 }
560
561 await reloadScreen();
562 setTimeout(taskReloader, timer);
563 // better use setTimeout instead of setInterval to avoid overlapping calls
564}
565async function autoReloadScreen() {
566 let timer = parseInt(eConfigAutoReload.value);
567

Callers 1

autoReloadScreenFunction · 0.85

Calls 2

$Function · 0.85
reloadScreenFunction · 0.85

Tested by

no test coverage detected