Fix audio attachments opening in video modal from media tab in web UI (#12056)

Fix video attachments having a GIF label in media tab in web UI
This commit is contained in:
Eugen Rochko
2019-10-03 03:34:58 +02:00
committed by GitHub
parent 9184522cb4
commit c9b8ba50f8
7 changed files with 99 additions and 9 deletions

View File

@@ -100,8 +100,10 @@ class AccountGallery extends ImmutablePureComponent {
}
handleOpenMedia = attachment => {
if (['video', 'audio'].includes(attachment.get('type'))) {
if (attachment.get('type') === 'video') {
this.props.dispatch(openModal('VIDEO', { media: attachment, status: attachment.get('status') }));
} else if (attachment.get('type') === 'audio') {
this.props.dispatch(openModal('AUDIO', { media: attachment, status: attachment.get('status') }));
} else {
const media = attachment.getIn(['status', 'media_attachments']);
const index = media.findIndex(x => x.get('id') === attachment.get('id'));