auto refresh fix

This commit is contained in:
Matt Walsh 2022-12-19 11:15:48 -06:00
parent c5b715d631
commit 21ef7f476a

View file

@ -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;
} }