Tunnel detail: Fix deletion of tunnel
This commit is contained in:
parent
d62c1fd84a
commit
1889614157
|
@ -204,14 +204,15 @@ extension TunnelDetailTableViewController {
|
||||||
cell.buttonText = "Delete tunnel"
|
cell.buttonText = "Delete tunnel"
|
||||||
cell.onTapped = { [weak self] in
|
cell.onTapped = { [weak self] in
|
||||||
guard let s = self else { return }
|
guard let s = self else { return }
|
||||||
s.tunnelsManager.remove(tunnel: s.tunnel) { (error) in
|
s.showConfirmationAlert(message: "Delete this tunnel?", buttonTitle: "Delete", from: cell) { [weak s] in
|
||||||
if (error != nil) {
|
guard let tunnelsManager = s?.tunnelsManager, let tunnel = s?.tunnel else { return }
|
||||||
print("Error removing tunnel: \(String(describing: error))")
|
tunnelsManager.remove(tunnel: tunnel) { (error) in
|
||||||
return
|
if (error != nil) {
|
||||||
}
|
print("Error removing tunnel: \(String(describing: error))")
|
||||||
s.showConfirmationAlert(message: "Delete this tunnel?", buttonTitle: "Delete", from: cell) { [weak s] in
|
return
|
||||||
s?.navigationController?.navigationController?.popToRootViewController(animated: true)
|
}
|
||||||
}
|
}
|
||||||
|
s?.navigationController?.navigationController?.popToRootViewController(animated: true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return cell
|
return cell
|
||||||
|
|
Loading…
Reference in New Issue