mirror of
https://github.com/passepartoutvpn/wireguard-apple.git
synced 2025-01-17 22:09:06 +00:00
TunnelsManager: startDeactivation() need not take a completion handler
Because the completion handler pattern doesn't fit in this case. Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
parent
95456ec956
commit
8e7bfb15ed
@ -159,9 +159,7 @@ extension TunnelDetailTableViewController {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
s.tunnelsManager.startDeactivation(of: s.tunnel) { error in
|
||||
print("Error while deactivating: \(String(describing: error))")
|
||||
}
|
||||
s.tunnelsManager.startDeactivation(of: s.tunnel)
|
||||
}
|
||||
}
|
||||
return cell
|
||||
|
@ -287,9 +287,7 @@ extension TunnelsListTableViewController: UITableViewDataSource {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
tunnelsManager.startDeactivation(of: tunnel) { [weak s] error in
|
||||
s?.showErrorAlert(title: "Deactivation error", message: "Error while bringing down tunnel: \(String(describing: error))")
|
||||
}
|
||||
tunnelsManager.startDeactivation(of: tunnel)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -200,9 +200,8 @@ class TunnelsManager {
|
||||
tunnel.startActivation(completionHandler: completionHandler)
|
||||
}
|
||||
|
||||
func startDeactivation(of tunnel: TunnelContainer, completionHandler: @escaping (Error?) -> Void) {
|
||||
func startDeactivation(of tunnel: TunnelContainer) {
|
||||
if (tunnel.status == .inactive) {
|
||||
completionHandler(TunnelActivationError.attemptingDeactivationWhenTunnelIsInactive)
|
||||
return
|
||||
}
|
||||
tunnel.startDeactivation()
|
||||
|
Loading…
Reference in New Issue
Block a user