Distance change is local-only: no re-fetch (full-UK cache already covers 5/10/15 miles)

This commit is contained in:
FuelBoard Contributor
2026-08-11 19:41:46 +01:00
parent d62ac1b265
commit 3cff677729
+6 -3
View File
@@ -156,9 +156,12 @@ struct ContentView: View {
// No re-fetch needed one response carries E5/E10/DIESEL prices. // No re-fetch needed one response carries E5/E10/DIESEL prices.
WidgetCenter.shared.reloadAllTimelines() WidgetCenter.shared.reloadAllTimelines()
} }
.onChange(of: stationLimit) { _, _ in .onChange(of: stationLimit) { _, newValue in
// Search radius changed (miles) cached stations may not cover it. // Distance filter is LOCAL math now the cache holds the full-UK
Task { await refresh(force: true) } // dump, so changing 5/10/15 miles never needs a network fetch.
// sortedStations/radiusScopedStations recompute on the next render.
FuelStore.saveStationLimit(newValue)
WidgetCenter.shared.reloadAllTimelines()
} }
.onChange(of: alertsEnabled) { _, newValue in .onChange(of: alertsEnabled) { _, newValue in
FuelStore.saveAlertsEnabled(newValue) FuelStore.saveAlertsEnabled(newValue)