mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
fix for a crash when trying to download a media
This commit is contained in:
@@ -21,7 +21,8 @@ protocol PhotoLibraryManagerProtocol {
|
||||
struct PhotoLibraryManager: PhotoLibraryManagerProtocol {
|
||||
func addResource(_ type: PHAssetResourceType, at url: URL) async -> Result<Void, PhotoLibraryManagerError> {
|
||||
do {
|
||||
try await PHPhotoLibrary.shared().performChanges {
|
||||
// @Sendable as PhotoKit runs the block on its own queue, so it must not inherit MainActor isolation.
|
||||
try await PHPhotoLibrary.shared().performChanges { @Sendable in
|
||||
let request = PHAssetCreationRequest.forAsset()
|
||||
let options = PHAssetResourceCreationOptions()
|
||||
request.addResource(with: type, fileURL: url, options: options)
|
||||
|
||||
Reference in New Issue
Block a user