]> cat aescling's git repositories - mastodon.git/commitdiff
Fix hasSize condition in secSet and sizes. (#4969)
authorNaoki Kosaka <n.k@mail.yukimochi.net>
Sat, 16 Sep 2017 13:00:01 +0000 (22:00 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Sat, 16 Sep 2017 13:00:01 +0000 (15:00 +0200)
app/javascript/mastodon/components/media_gallery.js

index 068220f8f5d4b799f4e9e1e9cc644ac137a4646d..78a2f5dc47613efdf12cffc2847cf5a15717a78d 100644 (file)
@@ -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