From 5fbd1da4db65e1fcd395ef5de497322b8fc78889 Mon Sep 17 00:00:00 2001 From: christian Date: Fri, 28 May 2021 13:47:37 -0400 Subject: [PATCH] fixed spot refresh on no tx every second --- package.nw/lib/gt.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/package.nw/lib/gt.js b/package.nw/lib/gt.js index d6a4c138..3f633f20 100644 --- a/package.nw/lib/gt.js +++ b/package.nw/lib/gt.js @@ -179,6 +179,7 @@ var g_flightDuration = 30; var g_crScript = g_appSettings.crScript; var g_spotsEnabled = g_appSettings.spotsEnabled; var g_heatEnabled = g_appSettings.heatEnabled; +var g_spotRefreshRequired = false; var g_myLat = g_mapSettings.latitude; var g_myLon = g_mapSettings.longitude; @@ -16027,6 +16028,9 @@ function pskSpotCheck(timeSec) g_receptionReports.lastDownloadTimeSec = timeSec; localStorage.receptionSettings = JSON.stringify(g_receptionSettings); spotRefreshDiv.innerHTML = "…refreshing…"; + // set refresh indicator. since we don't poll pskreporter if user doesn't tx we need + // a flag to refresh spots once after tx window exceeded + g_spotRefreshRequired = true; getBuffer( `https://retrieve.pskreporter.info/query?rronly=1&lastseqno=${g_receptionReports.lastSequenceNumber}` + `&senderCallsign=${encodeURIComponent(myRawCall)}` + @@ -16045,7 +16049,12 @@ function pskSpotCheck(timeSec) ) { spotRefreshDiv.innerHTML = "No recent TX"; - redrawSpots(); + // refresh spots once after tx window exceeded. flip the flag after that + if (g_spotRefreshRequired) + { + g_spotRefreshRequired = false; + redrawSpots(); + } } else {