close #13 refresh page at end of loop

This commit is contained in:
Matt Walsh
2022-11-14 15:10:07 -06:00
parent 878dea1ee6
commit 3f72ce0c89
2 changed files with 15 additions and 1 deletions

View File

@@ -461,7 +461,7 @@ const index = (() => {
document.getElementById('spanRefreshCountDown').innerHTML = `${dt.getMinutes() < 10 ? `0${dt.getMinutes()}` : dt.getMinutes()}:${dt.getSeconds() < 10 ? `0${dt.getSeconds()}` : dt.getSeconds()}`;
// Time has elapsed.
if (AutoRefreshCountMs >= AutoRefreshTotalIntervalMs) LoadTwcData();
if (AutoRefreshCountMs >= AutoRefreshTotalIntervalMs && !navigation.isPlaying()) LoadTwcData();
};
AutoRefreshIntervalId = window.setInterval(AutoRefreshTimer, AutoRefreshIntervalMs);
AutoRefreshTimer();
@@ -533,8 +533,18 @@ const index = (() => {
return noSleep.controller.disable();
};
const refreshCheck = () => {
// Time has elapsed.
if (AutoRefreshCountMs >= AutoRefreshTotalIntervalMs) {
LoadTwcData();
return true;
}
return false;
};
return {
init,
message,
refreshCheck,
};
})();