Remove Location status section; add 10/25/50/75/100 station limit picker; refresh location every foreground

This commit is contained in:
FuelBoard Contributor
2026-08-11 14:41:39 +01:00
parent 7304d99fd8
commit acb5c33578
2 changed files with 43 additions and 23 deletions
+14
View File
@@ -103,6 +103,7 @@ struct FuelStore {
static let locationKey = "fuelboard.lastLocation" // "lat,lng,timestamp"
static let fuelKey = "fuelboard.selectedFuel" // FuelType raw value
static let sortModeKey = "fuelboard.sortMode" // SortMode raw value
static let stationLimitKey = "fuelboard.stationLimit" // Int (10/25/50/75/100)
// MARK: Stations
@@ -167,6 +168,19 @@ struct FuelStore {
saveString(mode.rawValue, service: sortModeKey)
}
// MARK: Station count limit
static func loadStationLimit() -> Int {
if let raw = loadString(service: stationLimitKey), let value = Int(raw), [10, 25, 50, 75, 100].contains(value) {
return value
}
return 25
}
static func saveStationLimit(_ limit: Int) {
saveString(String(limit), service: stationLimitKey)
}
// MARK: Low-level keychain helpers
private static func keychainData(service: String) -> Data? {