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:
FuelBoard Contributor
2026-08-11 17:43:11 +01:00
parent 5a08a3a2fa
commit 8230daa249
3 changed files with 46 additions and 7 deletions
+5
View File
@@ -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")
}
}