Fixes erroneously showing “Unsupported Updates Available” message

This commit is contained in:
Riley Testut
2023-05-26 13:56:02 -05:00
committed by Magesh K
parent 26c173c479
commit 0fa941e6ef
3 changed files with 177 additions and 103 deletions

View File

@@ -347,6 +347,15 @@ extension AppManager
}
}
func fetchSources() async throws -> (Set<Source>, NSManagedObjectContext)
{
try await withCheckedThrowingContinuation { continuation in
self.fetchSources { result in
continuation.resume(with: result)
}
}
}
func add(@AsyncManaged _ source: Source, message: String? = nil, presentingViewController: UIViewController) async throws
{
let (sourceName, sourceURL) = await $source.perform { ($0.name, $0.sourceURL) }
@@ -422,6 +431,7 @@ extension AppManager
self.run([fetchSourceOperation], context: nil)
}
@available(*, renamed: "fetchSources")
func fetchSources(completionHandler: @escaping (Result<(Set<Source>, NSManagedObjectContext), FetchSourcesError>) -> Void)
{
DatabaseManager.shared.persistentContainer.performBackgroundTask { (context) in