From 583aa6fd6066aeeeac514d050010e68e6fc492ec Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 12 Oct 2021 13:46:09 -0500 Subject: [PATCH] MediaGallery: fix audio attachment thumb crash --- app/soapbox/components/media_gallery.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/soapbox/components/media_gallery.js b/app/soapbox/components/media_gallery.js index 7a6b77eea..a79ccbd43 100644 --- a/app/soapbox/components/media_gallery.js +++ b/app/soapbox/components/media_gallery.js @@ -197,21 +197,18 @@ class Item extends React.PureComponent { ); } else if (attachment.get('type') === 'audio') { - const remoteURL = attachment.get('remote_url'); - const originalUrl = attachment.get('url'); - const fileExtensionLastIndex = remoteURL.lastIndexOf('.'); - const fileExtension = remoteURL.substr(fileExtensionLastIndex + 1).toUpperCase(); + const ext = attachment.get('url').split('.').pop().toUpperCase(); thumbnail = ( - {fileExtension} + {ext} ); } else if (attachment.get('type') === 'video') {