about summary refs log tree commit diff
path: root/app/javascript/mastodon/features/account_gallery/index.js
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-10-03 03:34:58 +0200
committerGitHub <noreply@github.com>2019-10-03 03:34:58 +0200
commitc9b8ba50f8ad46e2f7821bb36af0c85e4b9a29df (patch)
treeefeeffc70726e5a27a34ffea48dab8401a5779d4 /app/javascript/mastodon/features/account_gallery/index.js
parent9184522cb49d87a58184a0561d46575ea1b5667d (diff)
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
Diffstat (limited to 'app/javascript/mastodon/features/account_gallery/index.js')
-rw-r--r--app/javascript/mastodon/features/account_gallery/index.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/javascript/mastodon/features/account_gallery/index.js b/app/javascript/mastodon/features/account_gallery/index.js
index f3bf7a2bd..de481075c 100644
--- a/app/javascript/mastodon/features/account_gallery/index.js
+++ b/app/javascript/mastodon/features/account_gallery/index.js
@@ -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'));