aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift
diff options
context:
space:
mode:
Diffstat (limited to 'WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift')
-rw-r--r--WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift10
1 files changed, 5 insertions, 5 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift b/WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift
index 7c28495..2889694 100644
--- a/WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift
+++ b/WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift
@@ -5,10 +5,10 @@ import UIKit
import os.log
class ErrorPresenter {
- static func showErrorAlert(error: WireGuardAppError, from sourceVC: UIViewController?,
- onPresented: (() -> Void)? = nil, onDismissal: (() -> Void)? = nil) {
+ static func showErrorAlert(error: WireGuardAppError, from sourceVC: UIViewController?, onPresented: (() -> Void)? = nil, onDismissal: (() -> Void)? = nil) {
guard let sourceVC = sourceVC else { return }
- guard let (title, message) = error.alertText() else { return }
+
+ let (title, message) = error.alertText()
let okAction = UIAlertAction(title: "OK", style: .default) { _ in
onDismissal?()
}
@@ -18,9 +18,9 @@ class ErrorPresenter {
sourceVC.present(alert, animated: true, completion: onPresented)
}
- static func showErrorAlert(title: String, message: String, from sourceVC: UIViewController?,
- onPresented: (() -> Void)? = nil, onDismissal: (() -> Void)? = nil) {
+ static func showErrorAlert(title: String, message: String, from sourceVC: UIViewController?, onPresented: (() -> Void)? = nil, onDismissal: (() -> Void)? = nil) {
guard let sourceVC = sourceVC else { return }
+
let okAction = UIAlertAction(title: "OK", style: .default) { _ in
onDismissal?()
}