[Fix]: Throw error only if the popup is not displayed

This commit is contained in:
Magesh K
2025-01-29 02:03:17 +05:30
parent df2ffb1235
commit b218437388
2 changed files with 3 additions and 3 deletions

View File

@@ -238,10 +238,10 @@ struct OperationError: ALTLocalizedError {
case .invalidParameters: case .invalidParameters:
let message = self._failureReason.map { ": \n\($0)" } ?? "." 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: case .invalidOperationContext:
let message = self._failureReason.map { ": \n\($0)" } ?? "." 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 .serverNotFound: return NSLocalizedString("AltServer could not be found.", comment: "")
case .connectionFailed: return NSLocalizedString("A connection to AltServer could not be established.", 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: "") case .connectionDropped: return NSLocalizedString("The connection to AltServer was dropped.", comment: "")

View File

@@ -85,7 +85,7 @@ final class RemoveAppExtensionsOperation: ResultOperation<Void>
presentingViewController.present(alertController, animated: true){ presentingViewController.present(alertController, animated: true){
// if for any reason the view wasn't presented, then just signal that as error // 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." + let errMsg = "RemoveAppExtensionsOperation: unable to present dialog, view context not available." +
"\nDid you move to different screen or background after starting the operation?" "\nDid you move to different screen or background after starting the operation?"
self.finish(.failure( self.finish(.failure(