mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
fix(location): fix weather fetching
This commit is contained in:
@@ -293,9 +293,26 @@ Singleton {
|
||||
return;
|
||||
}
|
||||
geolocate(function (lat, lng, city, country) {
|
||||
Logger.i("Location", "Geolocated to", city + ",", country);
|
||||
Logger.i("Location", "Geolocated to", city + ",", country + ":", lat + "," + lng);
|
||||
|
||||
const locationChanged = adapter.name !== city;
|
||||
Settings.data.location.name = city;
|
||||
resetWeather();
|
||||
adapter.name = city;
|
||||
adapter.latitude = lat.toString();
|
||||
adapter.longitude = lng.toString();
|
||||
root.stableLatitude = adapter.latitude;
|
||||
root.stableLongitude = adapter.longitude;
|
||||
root.stableName = `${city}, ${country}`;
|
||||
root.coordinatesReady = true;
|
||||
|
||||
if (locationChanged) {
|
||||
adapter.weatherLastFetch = 0;
|
||||
adapter.weather = null;
|
||||
}
|
||||
|
||||
if (Settings.data.location.weatherEnabled) {
|
||||
updateWeatherData();
|
||||
}
|
||||
}, errorCallback);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user