From b2b0fd4c6f428f8906091856bc61d2e3fb333105 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Fri, 26 May 2023 15:11:46 -0500 Subject: [PATCH] Fixes incorrectly handling misc. CancellationErrors --- AltStore/My Apps/MyAppsViewController.swift | 10 ++++++++++ .../Operations/BackgroundRefreshAppsOperation.swift | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/AltStore/My Apps/MyAppsViewController.swift b/AltStore/My Apps/MyAppsViewController.swift index 517a79c6..0ca07932 100644 --- a/AltStore/My Apps/MyAppsViewController.swift +++ b/AltStore/My Apps/MyAppsViewController.swift @@ -1171,6 +1171,9 @@ private extension MyAppsViewController catch OperationError.cancelled { // Ignore + DispatchQueue.main.async { + installedApp.isActive = false + } } catch { @@ -1244,6 +1247,13 @@ private extension MyAppsViewController print("Finished deactivating app:", app.bundleIdentifier) } + catch OperationError.cancelled + { + // Ignore + DispatchQueue.main.async { + installedApp.isActive = true + } + } catch { print("Failed to deactivate app:", error) diff --git a/AltStore/Operations/BackgroundRefreshAppsOperation.swift b/AltStore/Operations/BackgroundRefreshAppsOperation.swift index 25e51bb6..61cc32b4 100644 --- a/AltStore/Operations/BackgroundRefreshAppsOperation.swift +++ b/AltStore/Operations/BackgroundRefreshAppsOperation.swift @@ -208,6 +208,10 @@ private extension BackgroundRefreshAppsOperation content.title = NSLocalizedString("Refreshed Apps", comment: "") content.body = NSLocalizedString("All apps have been refreshed.", comment: "") } + catch is CancellationError + { + shouldPresentAlert = false + } catch ~OperationError.Code.serverNotFound { shouldPresentAlert = false