Present picker for .ovpn files

Do not auto-dismiss anymore if no imported files available.

XXX: use generic file types due to idiotic iOS 13 bug still unfixed.
This commit is contained in:
Davide De Rosa 2019-10-22 23:51:43 +02:00
parent a8f37cfd82
commit 9bff8629b3
1 changed files with 13 additions and 12 deletions

View File

@ -52,17 +52,17 @@ class ImportedHostsViewController: UITableViewController {
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
guard !pendingConfigurationURLs.isEmpty else {
let alert = UIAlertController.asAlert(
title,
L10n.Core.Organizer.Alerts.AddHost.message
)
alert.addCancelAction(L10n.Core.Global.ok) {
self.close()
}
present(alert, animated: true, completion: nil)
return
}
// guard !pendingConfigurationURLs.isEmpty else {
// let alert = UIAlertController.asAlert(
// title,
// L10n.Core.Organizer.Alerts.AddHost.message
// )
// alert.addCancelAction(L10n.Core.Global.ok) {
// self.close()
// }
// present(alert, animated: true, completion: nil)
// return
// }
if let selectedIP = tableView.indexPathForSelectedRow {
tableView.deselectRow(at: selectedIP, animated: true)
}
@ -71,7 +71,8 @@ class ImportedHostsViewController: UITableViewController {
// MARK: Actions
@IBAction private func openConfigurationFile() {
// TODO: open document picker
let picker = UIDocumentPickerViewController(documentTypes: ["public.content", "public.data"], in: .import)
present(picker, animated: true, completion: nil)
}
override func shouldPerformSegue(withIdentifier identifier: String, sender: Any?) -> Bool {