Просмотр исходного кода

Default snooze duration 20 min → 15 min

trioneer недель назад: 2
Родитель
Сommit
73d9512252

+ 8 - 8
Trio/Sources/Models/NotificationIdentifiers.swift

@@ -6,7 +6,7 @@ enum NotificationCategoryIdentifier: String {
 }
 }
 
 
 enum NotificationResponseAction: String, CaseIterable {
 enum NotificationResponseAction: String, CaseIterable {
-    case snooze20 = "Trio.snooze20"
+    case snooze15 = "Trio.snooze15"
     case snooze1hr = "Trio.snooze1hr"
     case snooze1hr = "Trio.snooze1hr"
     case snooze3hr = "Trio.snooze3hr"
     case snooze3hr = "Trio.snooze3hr"
     case snooze6hr = "Trio.snooze6hr"
     case snooze6hr = "Trio.snooze6hr"
@@ -17,8 +17,8 @@ enum NotificationResponseAction: String, CaseIterable {
 
 
     var minutes: Int {
     var minutes: Int {
         switch self {
         switch self {
-        case .snooze20:
-            return 20
+        case .snooze15:
+            return 15
         case .snooze1hr:
         case .snooze1hr:
             return 60
             return 60
         case .snooze3hr:
         case .snooze3hr:
@@ -30,14 +30,14 @@ enum NotificationResponseAction: String, CaseIterable {
 
 
     var localizedTitle: String {
     var localizedTitle: String {
         switch self {
         switch self {
-        case .snooze20:
-            return String(localized: "20 min", comment: "Snooze glucose alerts for 20 minutes")
+        case .snooze15:
+            return String(localized: "Snooze 15 min", comment: "Snooze glucose alerts for 15 minutes")
         case .snooze1hr:
         case .snooze1hr:
-            return String(localized: "1 hour", comment: "Snooze glucose alerts for 1 hour")
+            return String(localized: "Snooze 1 hr", comment: "Snooze glucose alerts for 1 hour")
         case .snooze3hr:
         case .snooze3hr:
-            return String(localized: "3 hours", comment: "Snooze glucose alerts for 3 hours")
+            return String(localized: "Snooze 3 hrs", comment: "Snooze glucose alerts for 3 hours")
         case .snooze6hr:
         case .snooze6hr:
-            return String(localized: "6 hours", comment: "Snooze glucose alerts for 6 hours")
+            return String(localized: "Snooze 6 hrs", comment: "Snooze glucose alerts for 6 hours")
         }
         }
     }
     }
 }
 }

+ 5 - 5
Trio/Sources/Services/Alerts/TrioModalAlertScheduler.swift

@@ -197,7 +197,7 @@ struct TrioAlertBanner: View {
     @State private var presentedAt = Date()
     @State private var presentedAt = Date()
     @State private var dragOffset: CGSize = .zero
     @State private var dragOffset: CGSize = .zero
 
 
-    private static let quickSnooze: TimeInterval = 20 * 60
+    private static let quickSnooze: TimeInterval = 15 * 60
 
 
     /// Critical alerts and urgent-low glucose alarms are limited to the
     /// Critical alerts and urgent-low glucose alarms are limited to the
     /// 20-minute quick snooze — the safety floor. Other alerts get the full
     /// 20-minute quick snooze — the safety floor. Other alerts get the full
@@ -305,7 +305,7 @@ struct TrioAlertBanner: View {
                 Button {
                 Button {
                     onSnooze(Self.quickSnooze)
                     onSnooze(Self.quickSnooze)
                 } label: {
                 } label: {
-                    Label(String(localized: "Snooze (20 min)"), systemImage: "moon.zzz")
+                    Label(String(localized: "Snooze (15 min)"), systemImage: "moon.zzz")
                 }
                 }
             } else {
             } else {
                 Section(String(localized: "Snooze")) {
                 Section(String(localized: "Snooze")) {
@@ -322,7 +322,7 @@ struct TrioAlertBanner: View {
     }
     }
 
 
     private var snoozeOptions: [NotificationResponseAction] {
     private var snoozeOptions: [NotificationResponseAction] {
-        isQuickSnoozeOnly ? [.snooze20] : NotificationResponseAction.allCases
+        isQuickSnoozeOnly ? [.snooze15] : NotificationResponseAction.allCases
     }
     }
 
 
     private func relativeTimestamp(now: Date) -> String {
     private func relativeTimestamp(now: Date) -> String {
@@ -390,10 +390,10 @@ struct TrioAlertModifier: ViewModifier {
         HStack {
         HStack {
             Spacer()
             Spacer()
             Button {
             Button {
-                scheduler.snoozeAll(duration: 20 * 60)
+                scheduler.snoozeAll(duration: 15 * 60)
             } label: {
             } label: {
                 HStack(spacing: 4) {
                 HStack(spacing: 4) {
-                    Text(String(localized: "Snooze all (20 min)"))
+                    Text(String(localized: "Snooze all (15 min)"))
                         .font(.footnote.weight(.semibold))
                         .font(.footnote.weight(.semibold))
                     Image(systemName: "moon.zzz.fill")
                     Image(systemName: "moon.zzz.fill")
                         .font(.footnote)
                         .font(.footnote)