Explorar el Código

update help text per review; delete old APN

kskandis hace 1 año
padre
commit
bfc04371f6

+ 2 - 2
FreeAPS/Sources/Modules/GlucoseNotificationSettings/View/GlucoseNotificationSettingsRootView.swift

@@ -184,7 +184,7 @@ extension GlucoseNotificationSettings {
                     verboseHint: VStack(alignment: .leading, spacing: 10) {
                         Text("Default: OFF").bold()
                         Text(
-                            "This will add your current glucose on the top right of your Trio icon as a red notification badge.  Changing setting takes effect on next Glucose reading."
+                            "This will add your current glucose on the top right of your Trio icon as a red notification badge. Changing setting takes effect on next Glucose reading."
                         )
                     },
                     headerText: "Various Glucose Notifications"
@@ -231,7 +231,7 @@ extension GlucoseNotificationSettings {
                                                 VStack(alignment: .leading, spacing: 5) {
                                                     Text("Only Alarm Limits:").bold()
                                                     Text(
-                                                        "A notification will be triggered only when glucose is below LOW and above HIGH settings as defined in Glucose Alarm Limits below."
+                                                        "A notification will be triggered only when glucose levels are below the LOW limit or above the HIGH limit, as specified in Glucose Alarm Limits below."
                                                     )
                                                 }
                                             }

+ 6 - 10
FreeAPS/Sources/Services/UserNotifications/UserNotificationsManager.swift

@@ -270,8 +270,6 @@ final class BaseUserNotificationsManager: NSObject, UserNotificationsManager, In
 
             addAppBadge(glucose: (glucoseObjects.first?.glucose).map { Int($0) })
 
-            guard settingsManager.settings.glucoseNotificationsOption != GlucoseNotificationsOption.disabled else { return }
-
             var titles: [String] = []
             var notificationAlarm = false
             var messageType = MessageType.info
@@ -421,24 +419,22 @@ final class BaseUserNotificationsManager: NSObject, UserNotificationsManager, In
             trigger: trigger,
             action: action
         )
-        if alertPermissionsChecker.notificationsDisabled {
-            router.alertMessage.send(messageCont)
-            return
-        }
-        guard router.allowNotify(messageCont, settingsManager.settings) else { return }
-
         var alertIdentifier = identifier.rawValue
         alertIdentifier = identifier == .pumpNotification ? alertIdentifier + content
             .title : (identifier == .alertMessageNotification ? alertIdentifier + content.body : alertIdentifier)
-        let request = UNNotificationRequest(identifier: alertIdentifier, content: content, trigger: trigger)
-
         if deleteOld {
             DispatchQueue.main.async {
                 self.center.removeDeliveredNotifications(withIdentifiers: [alertIdentifier])
                 self.center.removePendingNotificationRequests(withIdentifiers: [alertIdentifier])
             }
         }
+        if alertPermissionsChecker.notificationsDisabled {
+            router.alertMessage.send(messageCont)
+            return
+        }
+        guard router.allowNotify(messageCont, settingsManager.settings) else { return }
 
+        let request = UNNotificationRequest(identifier: alertIdentifier, content: content, trigger: trigger)
         DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
             self.center.add(request) { error in
                 if let error = error {