Update to allow all text types for importing OPML and make the error message more friendly. Issue #1443

This commit is contained in:
Maurice Parker 2020-01-20 14:57:07 -07:00
parent 61c854b031
commit ed355ad614

View File

@ -318,9 +318,10 @@ extension SettingsViewController: UIDocumentPickerDelegate {
switch result { switch result {
case .success: case .success:
break break
case .failure(let error): case .failure:
let title = NSLocalizedString("Import Failed", comment: "Import Failed") let title = NSLocalizedString("Import Failed", comment: "Import Failed")
self.presentError(title: title, message: error.localizedDescription) let message = NSLocalizedString("We were unable to process the selected file. Please ensure that it is a properly formatted OPML file.", comment: "Import Failed Message")
self.presentError(title: title, message: message)
} }
} }
} }
@ -382,7 +383,7 @@ private extension SettingsViewController {
} }
func importOPMLDocumentPicker() { func importOPMLDocumentPicker() {
let docPicker = UIDocumentPickerViewController(documentTypes: ["public.xml", "org.opml.opml"], in: .import) let docPicker = UIDocumentPickerViewController(documentTypes: ["public.text"], in: .import)
docPicker.delegate = self docPicker.delegate = self
docPicker.modalPresentationStyle = .formSheet docPicker.modalPresentationStyle = .formSheet
self.present(docPicker, animated: true) self.present(docPicker, animated: true)