diff options
author | 2018-11-05 23:38:41 +0530 | |
---|---|---|
committer | 2018-11-05 23:38:41 +0530 | |
commit | 733c29021e7c98f3662e31b029085e51220cb1a5 (patch) | |
tree | 6a7bf984e702dfb4aa37052a8ac6b240f6437205 | |
parent | Tunnel view model: No need to save if we already have a validated configuration object (diff) | |
download | wireguard-apple-733c29021e7c98f3662e31b029085e51220cb1a5.tar.xz wireguard-apple-733c29021e7c98f3662e31b029085e51220cb1a5.zip |
QR Code: Dismiss the QR code screen when the name prompt is cancelled
Signed-off-by: Roopesh Chander <roop@roopc.net>
-rw-r--r-- | WireGuard/WireGuard/UI/iOS/QRScanViewController.swift | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/QRScanViewController.swift b/WireGuard/WireGuard/UI/iOS/QRScanViewController.swift index ea9ece4..207fc43 100644 --- a/WireGuard/WireGuard/UI/iOS/QRScanViewController.swift +++ b/WireGuard/WireGuard/UI/iOS/QRScanViewController.swift @@ -114,7 +114,9 @@ class QRScanViewController: UIViewController { let alert = UIAlertController(title: NSLocalizedString("Please name the scanned tunnel", comment: ""), message: nil, preferredStyle: .alert) alert.addTextField(configurationHandler: nil) - alert.addAction(UIAlertAction(title: NSLocalizedString("Cancel", comment: ""), style: .cancel, handler: nil)) + alert.addAction(UIAlertAction(title: NSLocalizedString("Cancel", comment: ""), style: .cancel, handler: { [weak self] _ in + self?.dismiss(animated: true, completion: nil) + })) alert.addAction(UIAlertAction(title: NSLocalizedString("Save", comment: ""), style: .default, handler: { [weak self] _ in let title = alert.textFields?[0].text?.trimmingCharacters(in: .whitespacesAndNewlines) ?? "" if (title.isEmpty) { return } |