Sfoglia il codice sorgente

Merge branch 'dev' of github.com:nightscout/Trio into external-insulin-to-shortcut

Marvin Polscheit 10 mesi fa
parent
commit
0b7c97745a

+ 1 - 1
Config.xcconfig

@@ -19,7 +19,7 @@ TRIO_APP_GROUP_ID = group.org.nightscout.$(DEVELOPMENT_TEAM).trio.trio-app-group
 
 // The developers set the version numbers, please leave them alone
 APP_VERSION = 0.5.1
-APP_DEV_VERSION = 0.5.1.2
+APP_DEV_VERSION = 0.5.1.3
 APP_BUILD_NUMBER = 1
 COPYRIGHT_NOTICE =
 

+ 5 - 0
Trio/Sources/Services/LiveActivity/LiveActivityManager.swift

@@ -219,6 +219,11 @@ final class LiveActivityManager: Injectable, ObservableObject, SettingsObserver
     ///
     /// - Parameter state: The new content state to push to the live activity.
     @MainActor private func pushUpdate(_ state: LiveActivityAttributes.ContentState) async {
+        if !settings.useLiveActivity || !systemEnabled {
+            await endActivity()
+            return
+        }
+
         if currentActivity == nil {
             // try to restore an existing activity
             currentActivity = Activity<LiveActivityAttributes>.activities