remember gps setting on load
This commit is contained in:
parent
e9e68cc786
commit
5fd79f0b19
7 changed files with 75 additions and 50 deletions
|
|
@ -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);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue