Alerts choose their own fuel, independent of the Stations tab

The proximity monitor was tied to the Stations-tab fuel selection, so
switching the list to another fuel silently re-targeted geofences. Now the
Alerts tab has its own 'Fuel to monitor' picker (persisted as
fuelboard.alertsFuel):
- Monitor reads loadAlertsFuel() on init/background relaunch
- Changing the alerts fuel re-registers geofences around stations selling
  that fuel only
- Favourites priority slots stay scoped to the monitored fuel
- Tests: alerts fuel round-trip + default (33/33 passing)
This commit is contained in:
FuelBoard Contributor
2026-08-12 08:51:31 +01:00
parent 35e0adaf0b
commit 46d5d45c93
5 changed files with 67 additions and 11 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ final class ProximityMonitor: NSObject, ObservableObject, @preconcurrency CLLoca
// Restore persisted state on background relaunch so region events work
// even before the view fully appears.
enabled = FuelStore.loadAlertsEnabled()
fuel = FuelStore.loadSelectedFuel()
fuel = FuelStore.loadAlertsFuel()
radiusKM = FuelStore.loadAlertsRadius()
stations = FuelStore.loadStations()
favourites = FuelStore.loadFavourites().filter { $0.fuel == fuel }.map(\.station)