Both test buttons carry real station coords; map status surfaced
- Plain test notification now picks the nearest station selling the monitored fuel and carries its real name, price, distance and coordinates (was a static no-station notification) - addAlertRequest reports whether the map snapshot attached or why it failed, appended to the Settings result line instead of silently delivering a notification without the embedded map - Settings routes both test buttons through the live monitor
This commit is contained in:
@@ -18,6 +18,9 @@ struct SettingsView: View {
|
||||
/// Drives the real-data test — ContentView routes this to the live
|
||||
/// ProximityMonitor so the test uses its actual stations/fuel/radius.
|
||||
var onTestAlert: () -> Void = {}
|
||||
/// Drives the plain test (no criteria) — routed to the live monitor so it
|
||||
/// can carry a real station's name, price and coordinates.
|
||||
var onPlainTestAlert: () -> Void = {}
|
||||
var onShowOnboarding: () -> Void = {}
|
||||
|
||||
@StateObject private var tipStore = TipStore()
|
||||
@@ -72,14 +75,14 @@ struct SettingsView: View {
|
||||
.foregroundStyle(.green)
|
||||
}
|
||||
Button {
|
||||
ProximityMonitor.sendPlainTestNotification()
|
||||
onPlainTestAlert()
|
||||
} label: {
|
||||
Label("Send plain test notification", systemImage: "bell.slash.fill")
|
||||
}
|
||||
} header: {
|
||||
Text("Alerts")
|
||||
} footer: {
|
||||
Text("The first button applies the real criteria — cheapest \(alertsFuel.displayName.lowercased()) station within \(distanceUnit.format(alertsRadiusKM)) of you — and sends the actual station's name and price. The second fires with no criteria at all, just to verify a notification appears and tapping it opens FuelBoard.")
|
||||
Text("The first button applies the real criteria — cheapest \(alertsFuel.displayName.lowercased()) station within \(distanceUnit.format(alertsRadiusKM)) of you — and sends the actual station's name, price and coordinates. The second fires with no criteria at all (nearest seller), still carrying a real station, just to verify a notification appears and tapping it opens directions.")
|
||||
}
|
||||
|
||||
Section {
|
||||
|
||||
Reference in New Issue
Block a user