fix(weather): one failed fetch no longer parks the badge on the dash (#2167)

failed was set once and never cleared, so a single hiccup kept the badge on its error dash while later fetches quietly delivered data. It resets with every new anchor.
This commit is contained in:
Maurice
2026-09-02 19:01:17 +02:00
committed by Maurice
parent 1428637694
commit 31fa8908fc
2 changed files with 45 additions and 0 deletions
@@ -63,6 +63,10 @@ export default function WeatherWidget({ lat, lng, date, compact = false, stacked
useEffect(() => {
if (!lat || !lng || !date) return
let cancelled = false
// Every anchor, date or language change is a fresh attempt, so a failure from
// the previous one must not outlive it. Since #2167 the anchor is day-local and
// moves with each edit, which would otherwise pin the badge on the error dash.
setFailed(false)
const rLat = Math.round(lat * 100) / 100
const rLng = Math.round(lng * 100) / 100
// The language is part of the key: descriptions come back localized, and the