Fix being unable to commit previewed profile from timeline status

This commit is contained in:
Shadowfacts 2021-05-13 22:25:28 -04:00
parent e7e141bd1e
commit dabcae0905
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 15 additions and 0 deletions

View File

@ -314,4 +314,19 @@ extension TimelineStatusTableViewCell: UIContextMenuInteractionDelegate {
return UIMenu(title: "", image: nil, identifier: nil, options: [], children: self.actionsForProfile(accountID: self.accountID, sourceView: self.avatarImageView))
}
}
func contextMenuInteraction(_ interaction: UIContextMenuInteraction, willPerformPreviewActionForMenuWith configuration: UIContextMenuConfiguration, animator: UIContextMenuInteractionCommitAnimating) {
if let viewController = animator.previewViewController,
let delegate = navigationDelegate {
animator.preferredCommitStyle = .pop
animator.addCompletion {
if let customPresenting = viewController as? CustomPreviewPresenting {
customPresenting.presentFromPreview(presenter: delegate)
} else {
delegate.show(viewController)
}
}
}
}
}