auto refresh fix
This commit is contained in:
parent
c5b715d631
commit
21ef7f476a
|
@ -16,7 +16,7 @@ const weatherParameters = {};
|
||||||
|
|
||||||
// auto refresh
|
// auto refresh
|
||||||
const AUTO_REFRESH_INTERVAL_MS = 500;
|
const AUTO_REFRESH_INTERVAL_MS = 500;
|
||||||
const AUTO_REFRESH_TIME_MS = 600000; // 10 min.
|
const AUTO_REFRESH_TIME_MS = 6000; // 10 min.
|
||||||
let AutoRefreshIntervalId = null;
|
let AutoRefreshIntervalId = null;
|
||||||
let AutoRefreshCountMs = 0;
|
let AutoRefreshCountMs = 0;
|
||||||
|
|
||||||
|
@ -175,6 +175,7 @@ const navTo = (direction) => {
|
||||||
if (!firstDisplay) return;
|
if (!firstDisplay) return;
|
||||||
|
|
||||||
firstDisplay.navNext(msg.command.firstFrame);
|
firstDisplay.navNext(msg.command.firstFrame);
|
||||||
|
firstDisplay.showCanvas();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (direction === msg.command.nextFrame) currentDisplay().navNext();
|
if (direction === msg.command.nextFrame) currentDisplay().navNext();
|
||||||
|
@ -377,7 +378,7 @@ const stopAutoRefreshTimer = () => {
|
||||||
|
|
||||||
const refreshCheck = () => {
|
const refreshCheck = () => {
|
||||||
// Time has elapsed.
|
// Time has elapsed.
|
||||||
if (AutoRefreshCountMs >= AUTO_REFRESH_TIME_MS) {
|
if (AutoRefreshCountMs >= AUTO_REFRESH_TIME_MS && isPlaying()) {
|
||||||
loadTwcData();
|
loadTwcData();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue