diff --git a/submodules/TelegramUI/Components/MediaEditorScreen/Sources/MediaEditorScreen.swift b/submodules/TelegramUI/Components/MediaEditorScreen/Sources/MediaEditorScreen.swift index 419794ae11..5ae881fde0 100644 --- a/submodules/TelegramUI/Components/MediaEditorScreen/Sources/MediaEditorScreen.swift +++ b/submodules/TelegramUI/Components/MediaEditorScreen/Sources/MediaEditorScreen.swift @@ -3087,6 +3087,8 @@ public final class MediaEditorScreen: ViewController, UIDropInteractionDelegate return } + try? FileManager.default.createDirectory(atPath: draftPath(engine: self.context.engine), withIntermediateDirectories: true) + let isScopedResource = url.startAccessingSecurityScopedResource() Logger.shared.log("MediaEditor", "isScopedResource = \(isScopedResource)") @@ -3096,8 +3098,6 @@ public final class MediaEditorScreen: ViewController, UIDropInteractionDelegate let fileName = "audio_\(sourceUrl.lastPathComponent)" let copyPath = fullDraftPath(peerId: self.context.account.peerId, path: fileName) - Logger.shared.log("MediaEditor", "fileexists = \(FileManager.default.fileExists(atPath: sourceUrl.path))") - try? FileManager.default.removeItem(atPath: copyPath) do { try FileManager.default.copyItem(at: sourceUrl, to: URL(fileURLWithPath: copyPath))