Procházet zdrojové kódy

Fix handling of audio files in account media gallery (#11629)

Fixes #11627
master^2
ThibG před 4 roky
committed by Eugen Rochko
rodič
revize
b48c7ee059
2 změnil soubory, kde provedl 7 přidání a 1 odebrání
  1. +6
    -0
      app/javascript/mastodon/features/account_gallery/components/media_item.js
  2. +1
    -1
      app/javascript/mastodon/features/account_gallery/index.js

+ 6
- 0
app/javascript/mastodon/features/account_gallery/components/media_item.js Zobrazit soubor

@@ -96,6 +96,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'>
<Icon id='music' />
</span>
);
} else if (attachment.get('type') === 'image') {
const focusX = attachment.getIn(['meta', 'focus', 'x']) || 0;
const focusY = attachment.getIn(['meta', 'focus', 'y']) || 0;


+ 1
- 1
app/javascript/mastodon/features/account_gallery/index.js Zobrazit soubor

@@ -100,7 +100,7 @@ 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']);


Načítá se…
Zrušit
Uložit