From b9d0b9f096a3d636256e2d697e99faacc0daf056 Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Sat, 3 Nov 2018 17:28:16 +0530 Subject: [PATCH] Tunnels list: Fix status switch look after flipping it off after an error Signed-off-by: Roopesh Chander --- .../UI/iOS/TunnelsListTableViewController.swift | 9 +++++---- 1 file 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 {