From ed355ad61459a8534d47b8c56a79ca78efce1faa Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Mon, 20 Jan 2020 14:57:07 -0700 Subject: [PATCH] Update to allow all text types for importing OPML and make the error message more friendly. Issue #1443 --- iOS/Settings/SettingsViewController.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/iOS/Settings/SettingsViewController.swift b/iOS/Settings/SettingsViewController.swift index c0e12bfce..f9c5fe8f0 100644 --- a/iOS/Settings/SettingsViewController.swift +++ b/iOS/Settings/SettingsViewController.swift @@ -318,9 +318,10 @@ extension SettingsViewController: UIDocumentPickerDelegate { switch result { case .success: break - case .failure(let error): + case .failure: 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() { - let docPicker = UIDocumentPickerViewController(documentTypes: ["public.xml", "org.opml.opml"], in: .import) + let docPicker = UIDocumentPickerViewController(documentTypes: ["public.text"], in: .import) docPicker.delegate = self docPicker.modalPresentationStyle = .formSheet self.present(docPicker, animated: true)