sforkowany z mirror/soapbox
MediaGallery: fall back on `url` when `preview_url` isn't provided
rodzic
2c51054ae4
commit
c4bf347dae
|
@ -168,7 +168,7 @@ class Item extends React.PureComponent {
|
||||||
onClick={this.handleClick}
|
onClick={this.handleClick}
|
||||||
target='_blank'
|
target='_blank'
|
||||||
>
|
>
|
||||||
<StillImage src={previewUrl} alt={attachment.get('description')} />
|
<StillImage src={previewUrl || originalUrl} alt={attachment.get('description')} />
|
||||||
</a>
|
</a>
|
||||||
);
|
);
|
||||||
} else if (attachment.get('type') === 'gifv') {
|
} else if (attachment.get('type') === 'gifv') {
|
||||||
|
|
|
@ -88,7 +88,7 @@ class MediaItem extends ImmutablePureComponent {
|
||||||
|
|
||||||
thumbnail = (
|
thumbnail = (
|
||||||
<StillImage
|
<StillImage
|
||||||
src={attachment.get('preview_url')}
|
src={attachment.get('preview_url') || attachment.get('url')}
|
||||||
alt={attachment.get('description')}
|
alt={attachment.get('description')}
|
||||||
style={{ objectPosition: `${x}% ${y}%` }}
|
style={{ objectPosition: `${x}% ${y}%` }}
|
||||||
/>
|
/>
|
||||||
|
|
Ładowanie…
Reference in New Issue