mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-06-19 01:25:21 -04:00
fix(weather): robust location resolution with parallel fetch and multi-tier fallback (#2638)
Decouple weather data fetching from reverse geocoding so that weather loads as soon as coordinates are available, even when Nominatim is unreachable (e.g. mainland China). - Fetch Open-Meteo weather immediately once lat/lon are known. - Resolve city name in parallel via Nominatim -> Photon -> BigDataCloud. - If all reverse geocoding fails, keep displaying weather with a placeholder city name. - Skip reverse geocoding entirely when the user has configured a city name. - Fall back to ip-api.com when GeoClue2 is unavailable or returns zero coordinates. - Add request-generation tracking to discard stale geocoding responses after location changes. - Hold explicit WeatherService refs in bar widget and dashboard tab. Co-authored-by: lingdiansr <2077258365@qq.com>
This commit is contained in:
@@ -18,6 +18,9 @@ Item {
|
||||
property bool showHourly: false
|
||||
property bool available: WeatherService.weather.available
|
||||
|
||||
Component.onCompleted: WeatherService.addRef()
|
||||
Component.onDestruction: WeatherService.removeRef()
|
||||
|
||||
function syncFrom(type) {
|
||||
if (!dailyLoader.item || !hourlyLoader.item)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user