[Glitch] Fix Chrome issue with sizes="0px"

master
Thibaut Girka 7 years ago committed by ThibG
parent e96a4434c7
commit 33c1607c83
  1. 2
      app/javascript/flavours/glitch/components/media_gallery.js

@ -142,7 +142,7 @@ class Item extends React.PureComponent {
const hasSize = typeof originalWidth === 'number' && typeof previewWidth === 'number';
const srcSet = hasSize ? `${originalUrl} ${originalWidth}w, ${previewUrl} ${previewWidth}w` : null;
const sizes = hasSize ? `${displayWidth * (width / 100)}px` : null;
const sizes = hasSize && (displayWidth > 0) ? `${displayWidth * (width / 100)}px` : null;
const focusX = attachment.getIn(['meta', 'focus', 'x']) || 0;
const focusY = attachment.getIn(['meta', 'focus', 'y']) || 0;

Loading…
Cancel
Save