Explorar el Código

Hide badge commit 2/2

(cherry picked from commit 23888fe36217cfeec80554beba38c97f58a70cd3)
Jon Mårtensson hace 3 años
padre
commit
5ac12aafa5

+ 4 - 2
FreeAPS/Sources/Services/UserNotifiactions/UserNotificationsManager.swift

@@ -193,8 +193,10 @@ final class BaseUserNotificationsManager: NSObject, UserNotificationsManager, In
 
         if settingsManager.settings.tooOldGlucose {
             DispatchQueue.main.asyncAfter(deadline: .now() + 1200) {
-                print("CGM too old for glucose badge")
-                self.addAppBadge(glucose: nil)
+                // Make check double to remove the nil in case not needed anymore...
+                if lastGlucose.dateString.addingTimeInterval(19.minutes.timeInterval) < Date() {
+                    self.addAppBadge(glucose: nil)
+                } else { self.addAppBadge(glucose: lastGlucose.glucose) }
             }
         }