remember gps setting on load

This commit is contained in:
Matt Walsh
2022-12-13 15:43:06 -06:00
parent e9e68cc786
commit 5fd79f0b19
7 changed files with 75 additions and 50 deletions

View File

@@ -49,10 +49,12 @@ const message = (data) => {
}
};
const getWeather = async (latLon) => {
const getWeather = async (latLon, haveDataCallback) => {
// get initial weather data
const point = await getPoint(latLon.lat, latLon.lon);
if (typeof haveDataCallback === 'function') haveDataCallback(point);
// get stations
const stations = await json(point.properties.observationStations);
@@ -331,8 +333,8 @@ const AssignLastUpdate = (date) => {
}
};
const latLonReceived = (data) => {
getWeather(data);
const latLonReceived = (data, haveDataCallback) => {
getWeather(data, haveDataCallback);
AssignLastUpdate(null);
};