diff --git a/CHANGELOG.md b/CHANGELOG.md index e4f58b2a..acd1f6cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/Passepartout-iOS/Scenes/ServiceViewController.swift b/Passepartout-iOS/Scenes/ServiceViewController.swift index 71dc45fd..9d5f9e6e 100644 --- a/Passepartout-iOS/Scenes/ServiceViewController.swift +++ b/Passepartout-iOS/Scenes/ServiceViewController.swift @@ -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) {