Skip to content

Commit

Permalink
Resolved file size error for dropped files.
Browse files Browse the repository at this point in the history
  • Loading branch information
palakrathi committed Sep 2, 2020
1 parent 740bbc6 commit a8e2dc5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ const MAX_CHUNKSIZE = 104857600;
export const events = uploaderEvents;

const addFileSizes = files => {
files.forEach(file => {
const mappedFiles = files.map(file => {
if (file.size) {
return file['_parsedSize'] = getHumanFileSize(file.size)
} else {
return file.file(fl => file['_parsedSize'] = getHumanFileSize(fl.size));
file.file(fl => file['_parsedSize'] = getHumanFileSize(fl.size));
return file;
}
});
return files;
return mappedFiles;
}

const validateDataTransfer = (obj = {}) => {
Expand Down

0 comments on commit a8e2dc5

Please sign in to comment.