Compare commits

..

2 Commits

Author SHA1 Message Date
Matt Walsh
92b39845f2 4.1.5 2022-11-17 08:43:12 -06:00
Matt Walsh
3f72ce0c89 close #13 refresh page at end of loop 2022-11-17 08:42:41 -06:00
4 changed files with 18 additions and 4 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "ws4kp",
"version": "4.1.4",
"version": "4.1.5",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "ws4kp",
"version": "4.1.4",
"version": "4.1.5",
"license": "MIT",
"devDependencies": {
"del": "^6.0.0",

View File

@@ -1,6 +1,6 @@
{
"name": "ws4kp",
"version": "4.1.4",
"version": "4.1.5",
"description": "Welcome to the WeatherStar 4000+ project page!",
"main": "index.js",
"scripts": {

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,
};
})();

View File

@@ -194,6 +194,10 @@ const navigation = (() => {
idx = utils.calc.wrap(curIdx + (i + 1) * direction, totalDisplays);
if (displays[idx].status === STATUS.loaded) break;
}
// if new display index is less than current display a wrap occurred, test for reload timeout
if (idx <= curIdx) {
if (index.refreshCheck()) return;
}
const newDisplay = displays[idx];
// hide all displays
hideAllCanvases();