From 0893a686da0db968207c2c1d0559e293b478525e Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Mon, 21 Oct 2019 00:25:02 +0200 Subject: [PATCH] Always deselect after add current Wi-Fi --- Passepartout-iOS/Scenes/ServiceViewController.swift | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Passepartout-iOS/Scenes/ServiceViewController.swift b/Passepartout-iOS/Scenes/ServiceViewController.swift index 4852ca7f..d27660dd 100644 --- a/Passepartout-iOS/Scenes/ServiceViewController.swift +++ b/Passepartout-iOS/Scenes/ServiceViewController.swift @@ -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() } }