Fix alert fetch signature (radiusKM param); alert fetches within max(trigger radius, 10km)

This commit is contained in:
FuelBoard Contributor
2026-08-11 18:03:23 +01:00
parent 213f93aa04
commit 0fc24eab7c
+3 -2
View File
@@ -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 &&