fix(location): fix weather fetching

This commit is contained in:
Lemmy
2026-04-02 07:56:47 -04:00
parent 68f6f1f0a0
commit 6fcfc0c1d2
+19 -2
View File
@@ -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);
}