sforkowany z mirror/soapbox
Fix display of multiple rich media items
rodzic
c0c6c52621
commit
dedac70e58
|
@ -341,7 +341,10 @@ class Status extends ImmutablePureComponent {
|
||||||
if (status.get('poll')) {
|
if (status.get('poll')) {
|
||||||
poll = <PollContainer pollId={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) {
|
if (this.props.muted) {
|
||||||
media = (
|
media = (
|
||||||
<AttachmentList
|
<AttachmentList
|
||||||
|
@ -349,7 +352,7 @@ class Status extends ImmutablePureComponent {
|
||||||
media={status.get('media_attachments')}
|
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]);
|
const video = status.getIn(['media_attachments', 0]);
|
||||||
|
|
||||||
media = (
|
media = (
|
||||||
|
@ -373,7 +376,7 @@ class Status extends ImmutablePureComponent {
|
||||||
)}
|
)}
|
||||||
</Bundle>
|
</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]);
|
const audio = status.getIn(['media_attachments', 0]);
|
||||||
|
|
||||||
media = (
|
media = (
|
||||||
|
|
|
@ -89,6 +89,7 @@ export default class DetailedStatus extends ImmutablePureComponent {
|
||||||
const { compact } = this.props;
|
const { compact } = this.props;
|
||||||
const favicon = status.getIn(['account', 'pleroma', 'favicon']);
|
const favicon = status.getIn(['account', 'pleroma', 'favicon']);
|
||||||
const domain = getDomain(status.get('account'));
|
const domain = getDomain(status.get('account'));
|
||||||
|
const size = status.get('media_attachments').size;
|
||||||
|
|
||||||
if (!status) {
|
if (!status) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -105,8 +106,8 @@ export default class DetailedStatus extends ImmutablePureComponent {
|
||||||
if (status.get('poll')) {
|
if (status.get('poll')) {
|
||||||
poll = <PollContainer pollId={status.get('poll')} />;
|
poll = <PollContainer pollId={status.get('poll')} />;
|
||||||
}
|
}
|
||||||
if (status.get('media_attachments').size > 0) {
|
if (size > 0) {
|
||||||
if (status.getIn(['media_attachments', 0, 'type']) === 'video') {
|
if (size === 1 && status.getIn(['media_attachments', 0, 'type']) === 'video') {
|
||||||
const video = status.getIn(['media_attachments', 0]);
|
const video = status.getIn(['media_attachments', 0]);
|
||||||
|
|
||||||
media = (
|
media = (
|
||||||
|
@ -125,7 +126,7 @@ export default class DetailedStatus extends ImmutablePureComponent {
|
||||||
onToggleVisibility={this.props.onToggleMediaVisibility}
|
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]);
|
const audio = status.getIn(['media_attachments', 0]);
|
||||||
|
|
||||||
media = (
|
media = (
|
||||||
|
|
Ładowanie…
Reference in New Issue