Update media gallery view on the main thread
This commit is contained in:
parent
c3da50e5d5
commit
eaf36878a4
@ -110,11 +110,11 @@ class MediaGalleryItem: Equatable, Hashable, MediaGallerySectionItem {
|
||||
|
||||
var attachmentId: MediaGalleryResourceId { attachmentStream.reference.mediaGalleryResourceId }
|
||||
|
||||
typealias AsyncThumbnailBlock = (UIImage) -> Void
|
||||
typealias AsyncThumbnailBlock = @MainActor (UIImage) -> Void
|
||||
func thumbnailImage(async: @escaping AsyncThumbnailBlock) -> UIImage? {
|
||||
Task { [attachmentStream] in
|
||||
if let image = await attachmentStream.attachmentStream.thumbnailImage(quality: .small) {
|
||||
async(image)
|
||||
await async(image)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
||||
Loading…
Reference in New Issue
Block a user