aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2018-11-03 17:28:16 +0530
committerRoopesh Chander <roop@roopc.net>2018-11-03 17:28:16 +0530
commitb9d0b9f096a3d636256e2d697e99faacc0daf056 (patch)
tree3adf5ed56bab4c9037135261538dc7c896b75a03 /WireGuard
parentErrorPresenter: showErrorAlert takes an onPresentated handler (diff)
downloadwireguard-apple-b9d0b9f096a3d636256e2d697e99faacc0daf056.tar.xz
wireguard-apple-b9d0b9f096a3d636256e2d697e99faacc0daf056.zip
Tunnels list: Fix status switch look after flipping it off after an error
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard')
-rw-r--r--WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift9
1 files changed, 5 insertions, 4 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift b/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift
index f8c43c8..15da060 100644
--- a/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift
+++ b/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift
@@ -290,10 +290,11 @@ extension TunnelsListTableViewController: UITableViewDataSource {
if (isOn) {
tunnelsManager.startActivation(of: 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 {