Cache-first refresh policy: auto-fetch at most twice a day (12h gate), no fetch on launch/foreground/location/fuel-switch, pull-to-refresh forces; geofences still follow location
This commit is contained in:
@@ -14,6 +14,7 @@ struct StationsView: View {
|
||||
let radiusKM: Double
|
||||
let favouriteIDs: Set<String>
|
||||
var onToggleFavourite: (FuelStation) -> Void = { _ in }
|
||||
var onRefresh: () async -> Void = {}
|
||||
|
||||
var body: some View {
|
||||
NavigationStack {
|
||||
@@ -130,6 +131,10 @@ struct StationsView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
.refreshable {
|
||||
// Manual override for the twice-a-day cache policy.
|
||||
await onRefresh()
|
||||
}
|
||||
.navigationTitle("FuelBoard")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user