Don't use preview when image size is unknown (#4113)
This commit is contained in:
parent
852bda3d32
commit
76318f8830
3 changed files with 30 additions and 5 deletions
|
@ -74,7 +74,10 @@ export default class MediaModal extends ImmutablePureComponent {
|
|||
}
|
||||
|
||||
if (attachment.get('type') === 'image') {
|
||||
content = <ImageLoader previewSrc={attachment.get('preview_url')} src={url} width={attachment.getIn(['meta', 'original', 'width'])} height={attachment.getIn(['meta', 'original', 'height'])} />;
|
||||
const width = attachment.getIn(['meta', 'original', 'width']) || null;
|
||||
const height = attachment.getIn(['meta', 'original', 'height']) || null;
|
||||
|
||||
content = <ImageLoader previewSrc={attachment.get('preview_url')} src={url} width={width} height={height} />;
|
||||
} else if (attachment.get('type') === 'gifv') {
|
||||
content = <ExtendedVideoPlayer src={url} muted controls={false} />;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue