0
0
Fork 0

Don't use preview when image size is unknown (#4113)

This commit is contained in:
Yamagishi Kazutoshi 2017-07-09 00:21:59 +09:00 committed by Eugen Rochko
parent 852bda3d32
commit 76318f8830
3 changed files with 30 additions and 5 deletions

View file

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