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