Tunnel detail: Cell status switch should be toggled only after the alert presentation completes

This commit is contained in:
Roopesh Chander 2018-12-05 15:34:10 +05:30
parent 205585c5d4
commit 6cb5719d4e
1 changed files with 5 additions and 4 deletions

View File

@ -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 {