Skip to content
This repository has been archived by the owner on Jun 5, 2022. It is now read-only.

Commit

Permalink
single image fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
benjiekibblewhite committed Jan 23, 2020
1 parent d99740a commit 2ac403f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/component/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,11 @@ class ReactImageUploadComponent extends React.Component {
fileErrors
});

const {singleImage} = this.props;

Promise.all(allFilePromises).then(newFilesData => {
const dataURLs = this.state.pictures.slice();
const files = this.state.files.slice();
const dataURLs = singleImage?[]:this.state.pictures.slice();
const files = singleImage?[]:this.state.files.slice();

newFilesData.forEach(newFileData => {
dataURLs.push(newFileData.dataURL);
Expand Down

0 comments on commit 2ac403f

Please sign in to comment.