Cheapest reference uses chosen miles radius (same pool as list) in app + widget; header shows 'within N miles'

This commit is contained in:
FuelBoard Contributor
2026-08-11 18:29:20 +01:00
parent bcf4ea4f81
commit e0a5bb3d5d
3 changed files with 10 additions and 11 deletions
+1 -2
View File
@@ -11,7 +11,6 @@ struct StationsView: View {
@Binding var stationLimit: Int
let cheapestPrice: Double?
let location: Coordinate?
let radiusKM: Double
let favouriteIDs: Set<String>
var onToggleFavourite: (FuelStation) -> Void = { _ in }
var onRefresh: () async -> Void = {}
@@ -21,7 +20,7 @@ struct StationsView: View {
List {
Section {
if let location {
Text("\(sortMode == .closest ? "Closest" : "Cheapest") \(selectedFuel.displayName) within \(Int(radiusKM)) km — tap a station for directions.")
Text("\(sortMode == .closest ? "Closest" : "Cheapest") \(selectedFuel.displayName) within \(stationLimit) miles — tap a station for directions.")
.font(.footnote)
.foregroundStyle(.secondary)
} else {