Sfoglia il codice sorgente

fix: Address Mikes comment to not modify the duration of edited preset overrides (that much)

Marvin Polscheit 10 mesi fa
parent
commit
c560a0a261

+ 12 - 0
Trio/Resources/InfoPlist.xcstrings

@@ -457,6 +457,18 @@
         }
       }
     },
+    "NSCalendarsFullAccessUsageDescription" : {
+      "comment" : "Privacy - Calendars Full Access Usage Description",
+      "extractionState" : "extracted_with_value",
+      "localizations" : {
+        "en" : {
+          "stringUnit" : {
+            "state" : "new",
+            "value" : "To create events with BG reading values, so that they can be viewed on Apple Watch and CarPlay"
+          }
+        }
+      }
+    },
     "NSCalendarsUsageDescription" : {
       "comment" : "Privacy - Calendars Usage Description",
       "extractionState" : "extracted_with_value",

+ 5 - 1
Trio/Sources/APS/Storage/OverrideStorage.swift

@@ -179,7 +179,11 @@ final class BaseOverrideStorage: @preconcurrency OverrideStorage, Injectable {
         newOverride.smbIsOff = override.smbIsOff
         newOverride.name = override.name
         newOverride.isPreset = false // no Preset
-        newOverride.date = Date()
+        newOverride.date = override.date?
+            .addingTimeInterval(
+                1.seconds
+                    .timeInterval
+            ) // hacky solution to show the copied override as the latest override and at the same time not modify an already running preset duration
         newOverride.enabled = override.enabled
         newOverride.target = override.target
         newOverride.advancedSettings = override.advancedSettings

+ 3 - 0
Trio/Sources/Localizations/Main/Localizable.xcstrings

@@ -8832,6 +8832,9 @@
         }
       }
     },
+    "%lld h" : {
+
+    },
     "%lld hr" : {
       "localizations" : {
         "bg" : {

+ 1 - 1
Trio/Sources/Services/LiveActivity/LiveActivityManager.swift

@@ -239,7 +239,7 @@ final class LiveActivityManager: Injectable, ObservableObject, SettingsObserver
         }
 
         if let currentActivity {
-            if currentActivity.needsRecreation() && UIApplication.shared.applicationState == .active {
+            if currentActivity.needsRecreation(), UIApplication.shared.applicationState == .active {
                 debug(.default, "[LiveActivityManager] Ending current activity for recreation: \(currentActivity.activity.id)")
                 await endActivity()
                 // After endActivity(), currentActivity is guaranteed to be nil