Просмотр исходного кода

Merge branch 'dev' of https://github.com/nightscout/Trio-dev into onboarding

polscm32 1 год назад
Родитель
Сommit
a0fa196dc2
1 измененных файлов с 7 добавлено и 10 удалено
  1. 7 10
      Trio/Sources/Application/TrioApp.swift

+ 7 - 10
Trio/Sources/Application/TrioApp.swift

@@ -121,7 +121,7 @@ extension Notification.Name {
             do {
                 try await coreDataStack.initializeStack()
 
-                await MainActor.run {
+                await Task { @MainActor in
                     // Only load services after successful Core Data initialization
                     loadServices()
 
@@ -131,7 +131,12 @@ extension Notification.Name {
                     self.initState.complete = true
                     Foundation.NotificationCenter.default.post(name: .initializationCompleted, object: nil)
                     UIApplication.shared.registerForRemoteNotifications()
-                }
+                    do {
+                        try await BuildDetails.shared.handleExpireDateChange()
+                    } catch {
+                        debug(.default, "Failed to handle expire date change: \(error)")
+                    }
+                }.value
             } catch {
                 debug(
                     .coreData,
@@ -144,14 +149,6 @@ extension Notification.Name {
                 }
             }
         }
-
-        Task {
-            do {
-                try await BuildDetails.shared.handleExpireDateChange()
-            } catch {
-                debug(.default, "Failed to handle expire date change: \(error)")
-            }
-        }
     }
 
     /// Attempts to initialize the CoreDataStack again after a previous failure.