diff options
Diffstat (limited to 'WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift')
-rw-r--r-- | WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift b/WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift index 6d57006..0145fda 100644 --- a/WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift +++ b/WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift @@ -6,16 +6,8 @@ import os.log class ErrorPresenter { static func showErrorAlert(error: WireGuardAppError, from sourceVC: UIViewController?, onPresented: (() -> Void)? = nil, onDismissal: (() -> Void)? = nil) { - guard let sourceVC = sourceVC else { return } - let (title, message) = error.alertText - let okAction = UIAlertAction(title: "OK", style: .default) { _ in - onDismissal?() - } - let alert = UIAlertController(title: title, message: message, preferredStyle: .alert) - alert.addAction(okAction) - - sourceVC.present(alert, animated: true, completion: onPresented) + showErrorAlert(title: title, message: message, from: sourceVC, onPresented: onPresented, onDismissal: onDismissal) } static func showErrorAlert(title: String, message: String, from sourceVC: UIViewController?, onPresented: (() -> Void)? = nil, onDismissal: (() -> Void)? = nil) { |