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; + }, [ + + ]) + ) + }