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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user