Refine trends and debug harness; clean up warnings

This commit is contained in:
FuelBoard Contributor
2026-08-17 14:06:26 +01:00
parent 68d970720a
commit 63084322f6
16 changed files with 398 additions and 80 deletions
+7 -3
View File
@@ -408,7 +408,7 @@ struct SettingsView: View {
Label("In range", systemImage: "location.circle.fill")
Spacer()
HStack(spacing: 6) {
if let coord = status.coordinate {
if status.coordinate != nil {
Circle()
.fill(inRangeColor(status.inRangeCount))
.frame(width: 10, height: 10)
@@ -567,13 +567,17 @@ struct SettingsView: View {
testAlertMessage = NSLocalizedString("Notifications are turned off for FuelBoard. Enable them in Settings → Notifications → FuelBoard, then try again.", comment: "")
default:
// First time ask, then fire if granted.
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { granted, _ in
Task { @MainActor in
Task { @MainActor in
do {
let granted = try await UNUserNotificationCenter.current()
.requestAuthorization(options: [.alert, .sound, .badge])
if granted {
onTestAlert()
} else {
testAlertMessage = NSLocalizedString("Notifications weren't allowed, so no test alert was sent.", comment: "")
}
} catch {
testAlertMessage = NSLocalizedString("Couldn't request notification permission right now. Please try again.", comment: "")
}
}
}