Show gallery from conversation main status cell
This commit is contained in:
parent
85ed53b990
commit
cd5b593199
|
@ -193,11 +193,10 @@ class ConversationMainStatusTableViewCell: UITableViewCell, PreferencesAdaptive
|
||||||
|
|
||||||
extension ConversationMainStatusTableViewCell: AttachmentViewDelegate {
|
extension ConversationMainStatusTableViewCell: AttachmentViewDelegate {
|
||||||
func showLargeAttachment(for attachmentView: AttachmentView) {
|
func showLargeAttachment(for attachmentView: AttachmentView) {
|
||||||
if let gifData = attachmentView.gifData {
|
guard let status = MastodonCache.status(for: statusID) else { fatalError("Missing cached status \(statusID!)") }
|
||||||
delegate?.showLargeImage(gifData: gifData, description: attachmentView.attachment.description, animatingFrom: attachmentView)
|
let startIndex = status.attachments.firstIndex { $0.id == attachmentView.attachment.id } ?? 0
|
||||||
} else {
|
let sourceViews = status.attachments.map(attachmentsView.getAttachmentView(for:))
|
||||||
delegate?.showLargeImage(attachmentView.image!, description: attachmentView.attachment.description, animatingFrom: attachmentView)
|
delegate?.showGallery(attachments: status.attachments, sourceViews: sourceViews, startIndex: startIndex)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue