ソースを参照

allow to select particular backup file, improves import of backups of multiple accounts

cyberta 2 年 前
コミット
e6a916254c

+ 2 - 2
deltachat-ios/Controller/WelcomeViewController.swift

@@ -585,8 +585,8 @@ extension WelcomeViewController: MediaPickerDelegate {
             securityScopedResource = url
         }
 
-        if let path = url.relativePath, let filePath = dcContext.imexHasBackup(filePath: path) {
-            importBackup(at: filePath)
+        if let selectedBackupFilePath = url.relativePath {
+             importBackup(at: selectedBackupFilePath)
         } else {
             onSelectionCancelled()
             securityScopedResource = nil

+ 2 - 2
deltachat-ios/Helper/MediaPicker.swift

@@ -86,9 +86,9 @@ class MediaPicker: NSObject, UINavigationControllerDelegate {
         let documentPicker: UIDocumentPickerViewController
         if selectFolder {
             if #available(iOS 15.0, *) {
-                documentPicker = UIDocumentPickerViewController(forOpeningContentTypes: [UTType.folder], asCopy: false)
+                documentPicker = UIDocumentPickerViewController(forOpeningContentTypes: [UTType.archive], asCopy: false)
             } else {
-                documentPicker = UIDocumentPickerViewController(documentTypes: [kUTTypeFolder] as [String], in: .open)
+                documentPicker = UIDocumentPickerViewController(documentTypes: [kUTTypeArchive] as [String], in: .open)
             }
         } else {
             if #available(iOS 15.0, *) {