Fixes incorrectly handling misc. CancellationErrors

This commit is contained in:
Riley Testut
2023-05-26 15:11:46 -05:00
parent 895d7438c0
commit b2b0fd4c6f
2 changed files with 14 additions and 0 deletions

View File

@@ -1171,6 +1171,9 @@ private extension MyAppsViewController
catch OperationError.cancelled catch OperationError.cancelled
{ {
// Ignore // Ignore
DispatchQueue.main.async {
installedApp.isActive = false
}
} }
catch catch
{ {
@@ -1244,6 +1247,13 @@ private extension MyAppsViewController
print("Finished deactivating app:", app.bundleIdentifier) print("Finished deactivating app:", app.bundleIdentifier)
} }
catch OperationError.cancelled
{
// Ignore
DispatchQueue.main.async {
installedApp.isActive = true
}
}
catch catch
{ {
print("Failed to deactivate app:", error) print("Failed to deactivate app:", error)

View File

@@ -208,6 +208,10 @@ private extension BackgroundRefreshAppsOperation
content.title = NSLocalizedString("Refreshed Apps", comment: "") content.title = NSLocalizedString("Refreshed Apps", comment: "")
content.body = NSLocalizedString("All apps have been refreshed.", comment: "") content.body = NSLocalizedString("All apps have been refreshed.", comment: "")
} }
catch is CancellationError
{
shouldPresentAlert = false
}
catch ~OperationError.Code.serverNotFound catch ~OperationError.Code.serverNotFound
{ {
shouldPresentAlert = false shouldPresentAlert = false