Add trusted Wi-Fi with explicit name

This commit is contained in:
Davide De Rosa 2020-12-27 22:21:50 +01:00
parent b4b5782c58
commit 5cd416feb1
2 changed files with 18 additions and 9 deletions

View File

@ -5,7 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## 1.13.0 Beta 2405 (2020-11-15)
## Unreleased
### Changed
- Enter explicit Wi-Fi SSID to trust.
## 1.12.1 (2020-11-15)

View File

@ -430,15 +430,20 @@ class ServiceViewController: UIViewController, StrongTableHost {
IntentDispatcher.donateUntrustCurrentNetwork()
}
guard trustedNetworks.addCurrentWifi() else {
let alert = UIAlertController.asAlert(
L10n.Core.Service.Sections.Trusted.header,
L10n.Core.Service.Alerts.Trusted.NoNetwork.message
)
alert.addCancelAction(L10n.Core.Global.ok)
present(alert, animated: true, completion: nil)
return
let alert = UIAlertController.asAlert(L10n.Core.Service.Sections.Trusted.header, nil)
alert.addTextField { (field) in
field.text = Utils.currentWifiNetworkName() ?? ""
field.applyHostTitle(.current)
field.delegate = self
}
alert.addCancelAction(L10n.Core.Global.cancel)
alert.addPreferredAction(L10n.Core.Global.ok) {
guard let wifi = alert.textFields?.first?.text else {
return
}
self.trustedNetworks.addWifi(wifi)
}
present(alert, animated: true, completion: nil)
}
private func toggleTrustWiFi(cell: ToggleTableViewCell, at row: Int) {