[Glitch] Fix handling of audio files in account media gallery
Port 73b23ef7be
to glitch-soc
Signed-off-by: Thibaut Girka <thib@sitedethib.com>
This commit is contained in:
parent
0f22699c02
commit
c36ee7b85f
2 changed files with 7 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -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']);
|
||||
|
|
Loading…
Reference in a new issue