about summary refs log tree commit diff
path: root/app/javascript/mastodon/features/ui/components/image_loader.js
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>2017-11-25 23:41:45 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-11-25 15:41:45 +0100
commitbf7757cbbc7677fb46aee9a0a8d1b8a37ded7bb6 (patch)
tree4b044b0a0acea2021fc82bfbc47511aa097fe044 /app/javascript/mastodon/features/ui/components/image_loader.js
parent1266c66f79aac2fc6dc77fe08ad41b72e1887796 (diff)
Allow to open a modal for embedded photo (#5777)
Diffstat (limited to 'app/javascript/mastodon/features/ui/components/image_loader.js')
-rw-r--r--app/javascript/mastodon/features/ui/components/image_loader.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/javascript/mastodon/features/ui/components/image_loader.js b/app/javascript/mastodon/features/ui/components/image_loader.js
index aad594380..e3e7197c5 100644
--- a/app/javascript/mastodon/features/ui/components/image_loader.js
+++ b/app/javascript/mastodon/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(() => {