aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2018-12-05 15:34:10 +0530
committerRoopesh Chander <roop@roopc.net>2018-12-07 12:36:19 +0530
commit046b540e53d3208e4de52a3184579c3165dd1871 (patch)
tree49e56807d9931dcdcabf2633a60fbb7cc02a4bf5
parentRefactoring: Consolidate file deletion into a separate function (diff)
downloadwireguard-apple-046b540e53d3208e4de52a3184579c3165dd1871.tar.xz
wireguard-apple-046b540e53d3208e4de52a3184579c3165dd1871.zip
Tunnel detail: Cell status switch should be toggled only after the alert presentation completes
Signed-off-by: Roopesh Chander <roop@roopc.net>
-rw-r--r--WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift9
1 files changed, 5 insertions, 4 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift b/WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift
index 5e1727f..1bb337c 100644
--- a/WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift
+++ b/WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift
@@ -160,10 +160,11 @@ extension TunnelDetailTableViewController {
if (isOn) {
s.tunnelsManager.startActivation(of: s.tunnel) { [weak s] error in
if let error = error {
- ErrorPresenter.showErrorAlert(error: error, from: s)
- DispatchQueue.main.async {
- cell.statusSwitch.isOn = false
- }
+ ErrorPresenter.showErrorAlert(error: error, from: s, onPresented: {
+ DispatchQueue.main.async {
+ cell.statusSwitch.isOn = false
+ }
+ })
}
}
} else {