diff options
author | Thibaut Girka <thib@sitedethib.com> | 2018-04-08 23:06:33 +0200 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2018-04-08 23:06:33 +0200 |
commit | 0b86ec4e7fb45c1388a692b23f5ffc7d78b5076f (patch) | |
tree | 15fc5f0503dcc402a36f93fce7432db8a8db9472 /app/javascript/flavours/glitch/features/ui/components/image_loader.js | |
parent | 3ab6a8b8bed37d048909b178693af8411325eb38 (diff) |
[Glitch] Allow to open a modal for embedded photo
Port bf7757cbbc7677fb46aee9a0a8d1b8a37ded7bb6 to glitch-soc
Diffstat (limited to 'app/javascript/flavours/glitch/features/ui/components/image_loader.js')
-rw-r--r-- | app/javascript/flavours/glitch/features/ui/components/image_loader.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/features/ui/components/image_loader.js b/app/javascript/flavours/glitch/features/ui/components/image_loader.js index aad594380..e3e7197c5 100644 --- a/app/javascript/flavours/glitch/features/ui/components/image_loader.js +++ b/app/javascript/flavours/glitch/features/ui/components/image_loader.js @@ -7,7 +7,7 @@ export default class ImageLoader extends React.PureComponent { static propTypes = { alt: PropTypes.string, src: PropTypes.string.isRequired, - previewSrc: PropTypes.string.isRequired, + previewSrc: PropTypes.string, width: PropTypes.number, height: PropTypes.number, } @@ -47,7 +47,7 @@ export default class ImageLoader extends React.PureComponent { this.removeEventListeners(); this.setState({ loading: true, error: false }); Promise.all([ - this.loadPreviewCanvas(props), + props.previewSrc && this.loadPreviewCanvas(props), this.hasSize() && this.loadOriginalImage(props), ].filter(Boolean)) .then(() => { |