From 92850b082390977f723f3205f888dcb46cfac792 Mon Sep 17 00:00:00 2001 From: Markus Grigull Date: Sat, 19 Aug 2017 14:44:40 +0200 Subject: [PATCH] Add missing image path to image widget --- src/components/widget-image.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/widget-image.js b/src/components/widget-image.js index afacaa6..3f9914a 100644 --- a/src/components/widget-image.js +++ b/src/components/widget-image.js @@ -38,13 +38,15 @@ class WidgetImage extends React.Component { } render() { - let file = this.props.files.find(file => file._id === this.props.widget.file); + const file = this.props.files.find(file => file._id === this.props.widget.file); return (
- {file && + {file ? ( {file.name} e.preventDefault()} /> - } + ) : ( + missing-image e.preventDefault()} /> + )}
); }