Skip to content

Commit

Permalink
Fixed #99
Browse files Browse the repository at this point in the history
  • Loading branch information
Merve7 committed Sep 15, 2017
1 parent 29d0dab commit 863d5ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/fileupload/FileUpload.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export class FileUpload extends Component {
this.setState({msgs:[]});
let files = event.dataTransfer ? event.dataTransfer.files : event.target.files;
for(let file of files) {
if(this.isFileSelected(file)) {
if(!this.isFileSelected(file)) {
if (this.validate(file)) {
if (this.isImage(file)) {
file.objectURL = window.URL.createObjectURL(file);
Expand Down Expand Up @@ -147,9 +147,9 @@ export class FileUpload extends Component {
isFileSelected(file){
for(let sFile of this.state.files){
if((sFile.name + sFile.type + sFile.size) === (file.name + file.type+file.size))
return false;
return true;
}
return true;
return false;
}

validate(file) {
Expand Down

0 comments on commit 863d5ca

Please sign in to comment.