Always deselect after add current Wi-Fi

This commit is contained in:
Davide De Rosa 2019-10-21 00:25:02 +02:00
parent 5ae4abf401
commit 0893a686da
1 changed files with 6 additions and 7 deletions

View File

@ -341,7 +341,7 @@ class ServiceViewController: UIViewController, StrongTableHost {
}
}
private func trustCurrentWiFi() -> Bool {
private func trustCurrentWiFi() {
if #available(iOS 13, *) {
let auth = CLLocationManager.authorizationStatus()
switch auth {
@ -358,12 +358,12 @@ class ServiceViewController: UIViewController, StrongTableHost {
UIApplication.shared.open(URL(string: UIApplication.openSettingsURLString)!, options: [:], completionHandler: nil)
}
present(alert, animated: true, completion: nil)
return false
return
default:
locationManager.delegate = self
locationManager.requestWhenInUseAuthorization()
return false
return
}
}
@ -379,9 +379,8 @@ class ServiceViewController: UIViewController, StrongTableHost {
)
alert.addCancelAction(L10n.Core.Global.ok)
present(alert, animated: true, completion: nil)
return false
return
}
return true
}
private func toggleTrustedConnectionPolicy(_ isOn: Bool, sender: ToggleTableViewCell) {
@ -977,7 +976,7 @@ extension ServiceViewController: UITableViewDataSource, UITableViewDelegate, Tog
return true
case .trustedAddCurrentWiFi:
return trustCurrentWiFi()
trustCurrentWiFi()
case .testConnectivity:
testInternetConnectivity()
@ -1330,7 +1329,7 @@ extension ServiceViewController: CLLocationManagerDelegate {
func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) {
// can only change when calling this method, re-invoke
_ = trustCurrentWiFi()
trustCurrentWiFi()
}
}