Fix race between loading/animation when presenting gallery from attachment more view
This commit is contained in:
parent
490d48c635
commit
ae7101bb30
|
@ -39,6 +39,21 @@ class StatusAttachmentsGalleryDataSource: GalleryDataSource {
|
||||||
// TODO: if automatically play gifs is off, this will start the source view playing too
|
// TODO: if automatically play gifs is off, this will start the source view playing too
|
||||||
gifController: view.gifController
|
gifController: view.gifController
|
||||||
)
|
)
|
||||||
|
} else if let entry = ImageCache.attachments.get(attachment.url, loadOriginal: true) {
|
||||||
|
let gifController: GIFController? =
|
||||||
|
if attachment.url.pathExtension == "gif",
|
||||||
|
let data = entry.data {
|
||||||
|
GIFController(gifData: data)
|
||||||
|
} else {
|
||||||
|
nil
|
||||||
|
}
|
||||||
|
return ImageGalleryContentViewController(
|
||||||
|
url: attachment.url,
|
||||||
|
caption: attachment.description,
|
||||||
|
originalData: entry.data,
|
||||||
|
image: entry.image,
|
||||||
|
gifController: gifController
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
return LoadingGalleryContentViewController {
|
return LoadingGalleryContentViewController {
|
||||||
let (data, image) = await ImageCache.attachments.get(attachment.url, loadOriginal: true)
|
let (data, image) = await ImageCache.attachments.get(attachment.url, loadOriginal: true)
|
||||||
|
|
Loading…
Reference in New Issue