mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-14 15:49:31 -07:00
remember gps setting on load
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user