Distance change is local-only: no re-fetch (full-UK cache already covers 5/10/15 miles)
This commit is contained in:
@@ -156,9 +156,12 @@ struct ContentView: View {
|
||||
// No re-fetch needed — one response carries E5/E10/DIESEL prices.
|
||||
WidgetCenter.shared.reloadAllTimelines()
|
||||
}
|
||||
.onChange(of: stationLimit) { _, _ in
|
||||
// Search radius changed (miles) — cached stations may not cover it.
|
||||
Task { await refresh(force: true) }
|
||||
.onChange(of: stationLimit) { _, newValue in
|
||||
// Distance filter is LOCAL math now — the cache holds the full-UK
|
||||
// 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
|
||||
FuelStore.saveAlertsEnabled(newValue)
|
||||
|
||||
Reference in New Issue
Block a user