about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNaoki Kosaka <n.k@mail.yukimochi.net>2017-09-16 22:00:01 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-09-16 15:00:01 +0200
commitcea5597722bc7565e9d8dd21787492ba1570fbf4 (patch)
tree6f5eb789202724da7614975551838eb6af1a2d12
parent48d77ea1ebd6096a6ad5e265d99fa20e7a965276 (diff)
Fix hasSize condition in secSet and sizes. (#4969)
-rw-r--r--app/javascript/mastodon/components/media_gallery.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/javascript/mastodon/components/media_gallery.js b/app/javascript/mastodon/components/media_gallery.js
index 068220f8f..78a2f5dc4 100644
--- a/app/javascript/mastodon/components/media_gallery.js
+++ b/app/javascript/mastodon/components/media_gallery.js
@@ -119,8 +119,8 @@ class Item extends React.PureComponent {
 
       const hasSize = typeof originalWidth === 'number' && typeof previewWidth === 'number';
 
-      const srcSet = hasSize && `${originalUrl} ${originalWidth}w, ${previewUrl} ${previewWidth}w`;
-      const sizes = hasSize && `(min-width: 1025px) ${320 * (width / 100)}px, ${width}vw`;
+      const srcSet = hasSize ? `${originalUrl} ${originalWidth}w, ${previewUrl} ${previewWidth}w` : null;
+      const sizes = hasSize ? `(min-width: 1025px) ${320 * (width / 100)}px, ${width}vw` : null;
 
       thumbnail = (
         <a