Fix display of multiple rich media items

datepicker-css
Alex Gleason 2021-06-16 15:20:14 -05:00
rodzic c0c6c52621
commit dedac70e58
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
2 zmienionych plików z 10 dodań i 6 usunięć

Wyświetl plik

@ -341,7 +341,10 @@ class Status extends ImmutablePureComponent {
if (status.get('poll')) {
poll = <PollContainer pollId={status.get('poll')} />;
}
if (status.get('media_attachments').size > 0) {
const size = status.get('media_attachments').size;
if (size > 0) {
if (this.props.muted) {
media = (
<AttachmentList
@ -349,7 +352,7 @@ class Status extends ImmutablePureComponent {
media={status.get('media_attachments')}
/>
);
} else if (status.getIn(['media_attachments', 0, 'type']) === 'video') {
} else if (size === 1 && status.getIn(['media_attachments', 0, 'type']) === 'video') {
const video = status.getIn(['media_attachments', 0]);
media = (
@ -373,7 +376,7 @@ class Status extends ImmutablePureComponent {
)}
</Bundle>
);
} else if (status.getIn(['media_attachments', 0, 'type']) === 'audio' && status.get('media_attachments').size === 1) {
} else if (size === 1 && status.getIn(['media_attachments', 0, 'type']) === 'audio' && status.get('media_attachments').size === 1) {
const audio = status.getIn(['media_attachments', 0]);
media = (

Wyświetl plik

@ -89,6 +89,7 @@ export default class DetailedStatus extends ImmutablePureComponent {
const { compact } = this.props;
const favicon = status.getIn(['account', 'pleroma', 'favicon']);
const domain = getDomain(status.get('account'));
const size = status.get('media_attachments').size;
if (!status) {
return null;
@ -105,8 +106,8 @@ export default class DetailedStatus extends ImmutablePureComponent {
if (status.get('poll')) {
poll = <PollContainer pollId={status.get('poll')} />;
}
if (status.get('media_attachments').size > 0) {
if (status.getIn(['media_attachments', 0, 'type']) === 'video') {
if (size > 0) {
if (size === 1 && status.getIn(['media_attachments', 0, 'type']) === 'video') {
const video = status.getIn(['media_attachments', 0]);
media = (
@ -125,7 +126,7 @@ export default class DetailedStatus extends ImmutablePureComponent {
onToggleVisibility={this.props.onToggleMediaVisibility}
/>
);
} else if (status.getIn(['media_attachments', 0, 'type']) === 'audio' && status.get('media_attachments').size === 1) {
} else if (size === 1 && status.getIn(['media_attachments', 0, 'type']) === 'audio' && status.get('media_attachments').size === 1) {
const audio = status.getIn(['media_attachments', 0]);
media = (