From 4f6eaf1aac3b298954e5cd24b03a4aac3dcdf9fd 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 | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/AltStore/My Apps/MyAppsViewController.swift b/AltStore/My Apps/MyAppsViewController.swift index 692795c5..391eca44 100644 --- a/AltStore/My Apps/MyAppsViewController.swift +++ b/AltStore/My Apps/MyAppsViewController.swift @@ -1150,6 +1150,9 @@ private extension MyAppsViewController catch OperationError.cancelled { // Ignore + DispatchQueue.main.async { + installedApp.isActive = false + } } catch { @@ -1222,6 +1225,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 2437e83c..a59dc48c 100644 --- a/AltStore/Operations/BackgroundRefreshAppsOperation.swift +++ b/AltStore/Operations/BackgroundRefreshAppsOperation.swift @@ -223,6 +223,11 @@ private extension BackgroundRefreshAppsOperation { shouldPresentAlert = false } + catch ~OperationError.Code.serverNotFound + { + shouldPresentAlert = false + } + catch { print("Failed to refresh apps in background.", error)