瀏覽代碼

Merge pull request #346 from kskandis/DisableSnoozeCarbAPNs

disable carb notifications during snooze time
Deniz Cengiz 1 年之前
父節點
當前提交
26f90e9d8d
共有 1 個文件被更改,包括 3 次插入4 次删除
  1. 3 4
      Trio/Sources/Services/UserNotifications/UserNotificationsManager.swift

+ 3 - 4
Trio/Sources/Services/UserNotifications/UserNotificationsManager.swift

@@ -166,11 +166,10 @@ final class BaseUserNotificationsManager: NSObject, UserNotificationsManager, In
         let content = UNMutableNotificationContent()
 
         if snoozeUntilDate > Date() {
-            titles.append(String(localized: "(Snoozed)", comment: "(Snoozed)"))
-        } else {
-            content.sound = .default
-            playSoundIfNeeded()
+            return
         }
+        content.sound = .default
+        playSoundIfNeeded()
 
         titles.append(String(format: String(localized: "Carbs required: %d g", comment: "Carbs required"), carbs))