From: Roopesh Chander Date: Wed, 5 Dec 2018 10:04:10 +0000 (+0530) Subject: Tunnel detail: Cell status switch should be toggled only after the alert presentation... X-Git-Tag: 0.0.20181104-5~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=046b540e53d3208e4de52a3184579c3165dd1871;p=thirdparty%2Fwireguard-apple.git Tunnel detail: Cell status switch should be toggled only after the alert presentation completes Signed-off-by: Roopesh Chander --- 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 {