mirror of
https://github.com/passepartoutvpn/wireguard-apple.git
synced 2025-02-22 15:52:05 +00:00
Tunnel detail: Fix deletion of tunnel
Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
parent
040ce32015
commit
5138cdf9ea
@ -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
|
||||||
|
guard let tunnelsManager = s?.tunnelsManager, let tunnel = s?.tunnel else { return }
|
||||||
|
tunnelsManager.remove(tunnel: tunnel) { (error) in
|
||||||
if (error != nil) {
|
if (error != nil) {
|
||||||
print("Error removing tunnel: \(String(describing: error))")
|
print("Error removing tunnel: \(String(describing: error))")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
s.showConfirmationAlert(message: "Delete this tunnel?", buttonTitle: "Delete", from: cell) { [weak s] in
|
|
||||||
s?.navigationController?.navigationController?.popToRootViewController(animated: true)
|
|
||||||
}
|
}
|
||||||
|
s?.navigationController?.navigationController?.popToRootViewController(animated: true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return cell
|
return cell
|
||||||
|
Loading…
Reference in New Issue
Block a user