From e2be97dcd382a69c76eab322eac8cded1719fcae Mon Sep 17 00:00:00 2001 From: Ricardo Hernandez-Montoya Date: Mon, 8 May 2017 10:55:21 +0200 Subject: [PATCH] default edit image option and no images msg --- .../dialog/edit-widget-image-control.js | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/components/dialog/edit-widget-image-control.js b/src/components/dialog/edit-widget-image-control.js index 199a331..56ae8f0 100644 --- a/src/components/dialog/edit-widget-image-control.js +++ b/src/components/dialog/edit-widget-image-control.js @@ -49,11 +49,12 @@ class EditImageWidgetControl extends Component { formData.append(key, this.state.fileList[key]); } } - + // upload files AppDispatcher.dispatch({ type: 'files/start-upload', - data: formData + data: formData, + token: this.props.sessionToken }); } @@ -63,9 +64,18 @@ class EditImageWidgetControl extends Component { Image this.props.handleChange(e)}> - {this.props.files.map((file, index) => ( - - ))} + { + this.props.files.length === 0? ( + + ) : ( + this.props.files.reduce( (entries, file, index) => { + entries.push(); + return entries; + }, [ + + ]) + ) + }