Hide the entire top toolbar for videos & audio (#1070)

This commit is contained in:
Jed Fox 2023-06-29 02:54:10 -04:00 committed by GitHub
parent a6a25426ee
commit bd1339e9f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -113,12 +113,11 @@ extension MediaPreviewViewController {
guard let self = self else { return }
switch self.viewModel.item {
case .attachment(let previewContext):
let needsHideCloseButton: Bool = {
self.topToolbar.isHidden = {
guard index < previewContext.attachments.count else { return false }
let attachment = previewContext.attachments[index]
return attachment.kind == .video // not hide buttno for audio
return attachment.kind == .video || attachment.kind == .audio
}()
self.closeButton.isHidden = needsHideCloseButton
default:
break
}