From f7fdb2f7a3eeb8e604f28c78dcb4efa2dc7c657e Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Tue, 7 Jan 2020 14:49:33 +0100 Subject: [PATCH] make load speed more adapted to slow devices --- html/script.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/html/script.js b/html/script.js index 48aab9b..c139680 100644 --- a/html/script.js +++ b/html/script.js @@ -424,6 +424,15 @@ function fetchData() { refreshClock(new Date(now * 1000)); } + if (globeIndex) { + clearTimeout(refreshId); + if (mapIsVisible) { + refreshId = setTimeout(fetchData, RefreshInterval); + } else { + refreshId = setTimeout(fetchData, 55000); + } + } + // Check for stale receiver data if (last == now && !globeIndex) { StaleReceiverCount++;