QR Code: Dismiss the QR code screen when the name prompt is cancelled
Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
parent
f102051e22
commit
733c29021e
|
@ -114,7 +114,9 @@ class QRScanViewController: UIViewController {
|
||||||
|
|
||||||
let alert = UIAlertController(title: NSLocalizedString("Please name the scanned tunnel", comment: ""), message: nil, preferredStyle: .alert)
|
let alert = UIAlertController(title: NSLocalizedString("Please name the scanned tunnel", comment: ""), message: nil, preferredStyle: .alert)
|
||||||
alert.addTextField(configurationHandler: nil)
|
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
|
alert.addAction(UIAlertAction(title: NSLocalizedString("Save", comment: ""), style: .default, handler: { [weak self] _ in
|
||||||
let title = alert.textFields?[0].text?.trimmingCharacters(in: .whitespacesAndNewlines) ?? ""
|
let title = alert.textFields?[0].text?.trimmingCharacters(in: .whitespacesAndNewlines) ?? ""
|
||||||
if (title.isEmpty) { return }
|
if (title.isEmpty) { return }
|
||||||
|
|
Loading…
Reference in New Issue