From 7cf9dd64668612964b8705a3dd4dbd19686da105 Mon Sep 17 00:00:00 2001 From: Matt Walsh Date: Mon, 19 Dec 2022 11:27:02 -0600 Subject: [PATCH] almanac delivers data when disabled --- server/scripts/index.mjs | 1 - server/scripts/modules/almanac.mjs | 10 ++++++---- server/scripts/modules/navigation.mjs | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/server/scripts/index.mjs b/server/scripts/index.mjs index f39d816..1a5d527 100644 --- a/server/scripts/index.mjs +++ b/server/scripts/index.mjs @@ -368,7 +368,6 @@ const btnGetGpsClick = async () => { txtAddress.value = `${round2(latitude, 4)}, ${round2(longitude, 4)}`; doRedirectToGeometry({ y: latitude, x: longitude }, (point) => { - console.log(point); const location = point.properties.relativeLocation.properties; // Save the query const query = `${location.city}, ${location.state}`; diff --git a/server/scripts/modules/almanac.mjs b/server/scripts/modules/almanac.mjs index a75a9ad..0e9c803 100644 --- a/server/scripts/modules/almanac.mjs +++ b/server/scripts/modules/almanac.mjs @@ -22,7 +22,7 @@ class Almanac extends WeatherDisplay { } async getData(_weatherParameters) { - if (!super.getData(_weatherParameters)) return; + const superResponse = super.getData(_weatherParameters); const weatherParameters = _weatherParameters ?? this.weatherParameters; // get sun/moon data @@ -33,11 +33,13 @@ class Almanac extends WeatherDisplay { sun, moon, }; - // update status - this.setStatus(STATUS.loaded); - // share data this.getDataCallback(); + + if (!superResponse) return; + + // update status + this.setStatus(STATUS.loaded); } calcSunMoonData(weatherParameters) { diff --git a/server/scripts/modules/navigation.mjs b/server/scripts/modules/navigation.mjs index 8edcbe4..f6d3bbc 100644 --- a/server/scripts/modules/navigation.mjs +++ b/server/scripts/modules/navigation.mjs @@ -16,7 +16,7 @@ const weatherParameters = {}; // auto refresh const AUTO_REFRESH_INTERVAL_MS = 500; -const AUTO_REFRESH_TIME_MS = 6000; // 10 min. +const AUTO_REFRESH_TIME_MS = 600000; // 10 min. let AutoRefreshIntervalId = null; let AutoRefreshCountMs = 0;