summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2020-01-07 13:16:11 +0100
committerAndrej Mihajlov <and@mullvad.net>2020-01-08 15:02:46 +0100
commit6c46e91b90a7400f423db7f02df0e28a52a48758 (patch)
tree62b0e5f8a62217d86db76566b28392dfd64d3398
parentef6cca27616b113e805333b35d3059d507edee32 (diff)
downloadmullvadvpn-6c46e91b90a7400f423db7f02df0e28a52a48758.tar.xz
mullvadvpn-6c46e91b90a7400f423db7f02df0e28a52a48758.zip
Present errors
-rw-r--r--ios/MullvadVPN/AccountViewController.swift10
-rw-r--r--ios/MullvadVPN/ConnectViewController.swift7
2 files changed, 13 insertions, 4 deletions
diff --git a/ios/MullvadVPN/AccountViewController.swift b/ios/MullvadVPN/AccountViewController.swift
index eefb680d0b..51d8013737 100644
--- a/ios/MullvadVPN/AccountViewController.swift
+++ b/ios/MullvadVPN/AccountViewController.swift
@@ -31,8 +31,14 @@ class AccountViewController: UIViewController {
@IBAction func doLogout() {
logoutSubscriber = Account.shared.logout()
.receive(on: DispatchQueue.main)
- .sink(receiveCompletion: { (_) in
- self.performSegue(withIdentifier: SegueIdentifier.Account.logout.rawValue, sender: self)
+ .sink(receiveCompletion: { (completion) in
+ switch completion {
+ case .failure(let error):
+ self.presentError(error, preferredStyle: .alert)
+
+ case .finished:
+ self.performSegue(withIdentifier: SegueIdentifier.Account.logout.rawValue, sender: self)
+ }
})
}
diff --git a/ios/MullvadVPN/ConnectViewController.swift b/ios/MullvadVPN/ConnectViewController.swift
index f5924b224a..7d3361a512 100644
--- a/ios/MullvadVPN/ConnectViewController.swift
+++ b/ios/MullvadVPN/ConnectViewController.swift
@@ -96,7 +96,10 @@ class ConnectViewController: UIViewController, RootContainment, TunnelControlVie
.receive(on: DispatchQueue.main)
.sink(receiveCompletion: { (completion) in
if case .failure(let error) = completion {
- os_log(.error, "Failed to start the tunnel: %{public}s", error.localizedDescription)
+ os_log(.error, "Failed to start the tunnel: %{public}s",
+ error.localizedDescription)
+
+ self.presentError(error, preferredStyle: .alert)
}
})
}
@@ -104,7 +107,7 @@ class ConnectViewController: UIViewController, RootContainment, TunnelControlVie
private func disconnectTunnel() {
startStopTunnelSubscriber = TunnelManager.shared.stopTunnel()
.receive(on: DispatchQueue.main)
- .sink(receiveCompletion: { (_) in
+ .sink(receiveCompletion: { (completion) in
// no-op
})
}