[AltStoreCore] Renames AsyncManaged.get() to perform()

Implies it can be used as alternative to managedObject.managedObjectContext.perform() and not just for retrieving values.
This commit is contained in:
Riley Testut
2023-05-11 14:41:01 -05:00
committed by Magesh K
parent 5b275d6811
commit a09f4bbd7a
2 changed files with 28 additions and 20 deletions

View File

@@ -355,7 +355,7 @@ extension AppManager
func add(@AsyncManaged _ source: Source, message: String? = nil, presentingViewController: UIViewController) async throws
{
let (sourceName, sourceURL) = await $source.get { ($0.name, $0.sourceURL) }
let (sourceName, sourceURL) = await $source.perform { ($0.name, $0.sourceURL) }
let context = DatabaseManager.shared.persistentContainer.newBackgroundContext()
async let fetchedSource = try await self.fetchSource(sourceURL: sourceURL, managedObjectContext: context) // Fetch source async while showing alert.
@@ -375,7 +375,7 @@ extension AppManager
func remove(@AsyncManaged _ source: Source, presentingViewController: UIViewController) async throws
{
let (sourceName, sourceID) = await $source.get { ($0.name, $0.identifier) }
let (sourceName, sourceID) = await $source.perform { ($0.name, $0.identifier) }
guard sourceID != Source.altStoreIdentifier else {
throw OperationError.forbidden(failureReason: NSLocalizedString("The default AltStore source cannot be removed.", comment: ""))
}