()
| 547 | const eConfigAutoReload = $("#navigator-auto-reload"); |
| 548 | let AUTO_RELOAD_SCREEN = null; |
| 549 | async 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 | } |
| 565 | async function autoReloadScreen() { |
| 566 | let timer = parseInt(eConfigAutoReload.value); |
| 567 |
no test coverage detected