From b2184373888c37a108af04130bba7ae627102de4 Mon Sep 17 00:00:00 2001 From: Magesh K <47920326+mahee96@users.noreply.github.com> Date: Wed, 29 Jan 2025 02:03:17 +0530 Subject: [PATCH] [Fix]: Throw error only if the popup is not displayed --- AltStore/Operations/Errors/OperationError.swift | 4 ++-- AltStore/Operations/RemoveAppExtensionsOperation.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/AltStore/Operations/Errors/OperationError.swift b/AltStore/Operations/Errors/OperationError.swift index 52486a1b..103287e0 100644 --- a/AltStore/Operations/Errors/OperationError.swift +++ b/AltStore/Operations/Errors/OperationError.swift @@ -238,10 +238,10 @@ struct OperationError: ALTLocalizedError { case .invalidParameters: let message = self._failureReason.map { ": \n\($0)" } ?? "." - return String(format: NSLocalizedString("Invalid parameters\n%@", comment: ""), message) + return String(format: NSLocalizedString("Invalid parameters%@", comment: ""), message) case .invalidOperationContext: let message = self._failureReason.map { ": \n\($0)" } ?? "." - return String(format: NSLocalizedString("Invalid Operation Context\n%@", comment: ""), message) + return String(format: NSLocalizedString("Invalid Operation Context%@", comment: ""), message) case .serverNotFound: return NSLocalizedString("AltServer could not be found.", comment: "") case .connectionFailed: return NSLocalizedString("A connection to AltServer could not be established.", comment: "") case .connectionDropped: return NSLocalizedString("The connection to AltServer was dropped.", comment: "") diff --git a/AltStore/Operations/RemoveAppExtensionsOperation.swift b/AltStore/Operations/RemoveAppExtensionsOperation.swift index da12500a..f60ce233 100644 --- a/AltStore/Operations/RemoveAppExtensionsOperation.swift +++ b/AltStore/Operations/RemoveAppExtensionsOperation.swift @@ -85,7 +85,7 @@ final class RemoveAppExtensionsOperation: ResultOperation presentingViewController.present(alertController, animated: true){ // if for any reason the view wasn't presented, then just signal that as error - if presentingViewController.presentedViewController == nil { + if presentingViewController.presentedViewController == nil && !alertController.isViewLoaded { let errMsg = "RemoveAppExtensionsOperation: unable to present dialog, view context not available." + "\nDid you move to different screen or background after starting the operation?" self.finish(.failure(