Merge pull request #1200 from ThibG/glitch-soc/merge-upstream

Merge upstream changes
master
ThibG 5 years ago committed by GitHub
commit da7e0d4f55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      app/javascript/flavours/glitch/features/account_gallery/components/media_item.js
  2. 2
      app/javascript/flavours/glitch/features/account_gallery/index.js
  3. 6
      app/javascript/mastodon/features/account_gallery/components/media_item.js
  4. 2
      app/javascript/mastodon/features/account_gallery/index.js

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

@ -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;

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

Loading…
Cancel
Save