Skip to content

Commit b8f360f

Browse files
committed
fix: fix the issue of inconsistency between selected files and returned files.
1 parent 8c540d5 commit b8f360f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

plugins/dialog/ios/Sources/FilePickerController.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,7 @@ public class FilePickerController: NSObject {
119119
extension FilePickerController: UIDocumentPickerDelegate {
120120
public func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) {
121121
do {
122-
let temporaryUrls = try urls.map { try saveTemporaryFile($0) }
123-
self.plugin.onFilePickerEvent(.selected(temporaryUrls))
122+
self.plugin.onFilePickerEvent(.selected(urls))
124123
} catch {
125124
self.plugin.onFilePickerEvent(.error("Failed to create a temporary copy of the file"))
126125
}
@@ -149,8 +148,7 @@ extension FilePickerController: UIImagePickerControllerDelegate, UINavigationCon
149148
dismissViewController(picker) {
150149
if let url = info[.mediaURL] as? URL {
151150
do {
152-
let temporaryUrl = try self.saveTemporaryFile(url)
153-
self.plugin.onFilePickerEvent(.selected([temporaryUrl]))
151+
self.plugin.onFilePickerEvent(.selected([url]))
154152
} catch {
155153
self.plugin.onFilePickerEvent(.error("Failed to create a temporary copy of the file"))
156154
}

0 commit comments

Comments
 (0)