Skip to content

Commit

Permalink
Fixed auto updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Çağatay Çivici committed Sep 9, 2017
1 parent dbb8471 commit ee6fd42
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/components/fileupload/FileUpload.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,18 +124,18 @@ export class FileUpload extends Component {
file.objectURL = window.URL.createObjectURL(file);
}

this.setState({files: [...this.state.files, file]});
this.setState({files: [...this.state.files, file]}, () => {
if(this.hasFiles() && this.props.auto) {
this.upload();
}
});
}
}

if(this.props.onSelect) {
this.props.onSelect({originalEvent: event, files: this.state.files});
}

if(this.hasFiles() && this.props.auto) {
this.upload();
}

this.clearInputElement();

if(this.props.mode === 'basic') {
Expand Down

0 comments on commit ee6fd42

Please sign in to comment.