Fix playing gifs from a background thread

This commit is contained in:
Shadowfacts 2020-11-03 15:49:30 -05:00
parent 4ac76ab672
commit 0a11d2de47
Signed by untrusted user: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 3 additions and 1 deletions

View File

@ -165,7 +165,9 @@ class AttachmentView: UIImageView, GIFAnimatable {
if self.attachment.url.pathExtension == "gif" { if self.attachment.url.pathExtension == "gif" {
self.source = .gifData(attachmentURL, data) self.source = .gifData(attachmentURL, data)
if self.autoplayGifs { if self.autoplayGifs {
self.animate(withGIFData: data) DispatchQueue.main.async {
self.animate(withGIFData: data)
}
} else { } else {
self.displayImage() self.displayImage()
} }