Remove Location status section; add 10/25/50/75/100 station limit picker; refresh location every foreground
This commit is contained in:
@@ -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? {
|
||||
|
||||
Reference in New Issue
Block a user