]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Fix handling of audio files in account media gallery
authorThibG <thib@sitedethib.com>
Tue, 20 Aug 2019 17:46:41 +0000 (19:46 +0200)
committerThibaut Girka <thib@sitedethib.com>
Tue, 20 Aug 2019 18:38:42 +0000 (20:38 +0200)
Port b48c7ee059d0e08fff4bdf7fe7b0e09565288252 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
app/javascript/flavours/glitch/features/account_gallery/components/media_item.js
app/javascript/flavours/glitch/features/account_gallery/index.js

index 026136b2c2ccc618c1a19d44e87a24f65de167e4..d60e0671522a219ce3a566d791fe38eded262e3f 100644 (file)
@@ -94,6 +94,12 @@ export default class MediaItem extends ImmutablePureComponent {
 
     if (attachment.get('type') === 'unknown') {
       // Skip
+    } else if (attachment.get('type') === 'audio') {
+      thumbnail = (
+        <span className='account-gallery__item__icons'>
+          <i className='fa fa-music' />
+        </span>
+      );
     } else if (attachment.get('type') === 'image') {
       const focusX = attachment.getIn(['meta', 'focus', 'x']) || 0;
       const focusY = attachment.getIn(['meta', 'focus', 'y']) || 0;
index 3e44213067bb1ce58d4345229afac12bd1d31f2b..66b938bead873ce648af0613de65d3899e15a652 100644 (file)
@@ -111,7 +111,7 @@ export default class AccountGallery extends ImmutablePureComponent {
   }
 
   handleOpenMedia = attachment => {
-    if (attachment.get('type') === 'video') {
+    if (['video', 'audio'].includes(attachment.get('type'))) {
       this.props.dispatch(openModal('VIDEO', { media: attachment, status: attachment.get('status') }));
     } else {
       const media = attachment.getIn(['status', 'media_attachments']);