forked from shadowfacts/Tusker
Fix blurhash image being used as gallery content
This commit is contained in:
parent
fe00015248
commit
eafb506d64
|
@ -30,7 +30,7 @@ class StatusAttachmentsGalleryDataSource: GalleryDataSource {
|
|||
switch attachment.kind {
|
||||
case .image:
|
||||
if let view = attachmentView(for: attachment),
|
||||
let image = view.image {
|
||||
let image = view.attachmentImage {
|
||||
return ImageGalleryContentViewController(
|
||||
url: attachment.url,
|
||||
caption: attachment.description,
|
||||
|
|
|
@ -32,6 +32,16 @@ class AttachmentView: GIFImageView {
|
|||
|
||||
private var loadAttachmentTask: Task<Void, Never>?
|
||||
private var source: Source?
|
||||
var attachmentImage: UIImage? {
|
||||
switch source {
|
||||
case .image(_, _, let image):
|
||||
return image
|
||||
case .gifData(_, _, let image):
|
||||
return image
|
||||
case nil:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
var originalData: Data? {
|
||||
switch source {
|
||||
case .image(_, let data, _):
|
||||
|
|
Loading…
Reference in New Issue