Fix alert fetch signature (radiusKM param); alert fetches within max(trigger radius, 10km)
This commit is contained in:
@@ -132,9 +132,10 @@ final class ProximityMonitor: NSObject, ObservableObject, @preconcurrency CLLoca
|
|||||||
|
|
||||||
Task {
|
Task {
|
||||||
do {
|
do {
|
||||||
// Fresh prices around the entered station.
|
// Fresh prices around the entered station (alert radius in km).
|
||||||
let fresh = try await FuelPriceProvider.active.fetchStations(
|
let fresh = try await FuelPriceProvider.active.fetchStations(
|
||||||
near: station.lat, lng: station.lng, fuel: fuel
|
near: station.lat, lng: station.lng, fuel: fuel,
|
||||||
|
radiusKM: max(radiusKM, 10) // fetch wider than trigger radius
|
||||||
)
|
)
|
||||||
let withinRadius = fresh.filter {
|
let withinRadius = fresh.filter {
|
||||||
$0.prices[fuel] != nil &&
|
$0.prices[fuel] != nil &&
|
||||||
|
|||||||
Reference in New Issue
Block a user