From fc7e6fccd851278856ef78d82665a4d2eb0823cd Mon Sep 17 00:00:00 2001 From: nashaofu Date: Sat, 15 Feb 2025 09:22:38 +0800 Subject: [PATCH] fix: Fix the issue of inconsistency between selected files and returned files. --- plugins/dialog/ios/Sources/FilePickerController.swift | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/dialog/ios/Sources/FilePickerController.swift b/plugins/dialog/ios/Sources/FilePickerController.swift index b2752f0b..20e3119e 100644 --- a/plugins/dialog/ios/Sources/FilePickerController.swift +++ b/plugins/dialog/ios/Sources/FilePickerController.swift @@ -119,8 +119,7 @@ public class FilePickerController: NSObject { extension FilePickerController: UIDocumentPickerDelegate { public func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) { do { - let temporaryUrls = try urls.map { try saveTemporaryFile($0) } - self.plugin.onFilePickerEvent(.selected(temporaryUrls)) + self.plugin.onFilePickerEvent(.selected(urls)) } catch { self.plugin.onFilePickerEvent(.error("Failed to create a temporary copy of the file")) } @@ -149,8 +148,7 @@ extension FilePickerController: UIImagePickerControllerDelegate, UINavigationCon dismissViewController(picker) { if let url = info[.mediaURL] as? URL { do { - let temporaryUrl = try self.saveTemporaryFile(url) - self.plugin.onFilePickerEvent(.selected([temporaryUrl])) + self.plugin.onFilePickerEvent(.selected([url])) } catch { self.plugin.onFilePickerEvent(.error("Failed to create a temporary copy of the file")) }