Skip to content

Commit

Permalink
Merge pull request #24833 from nextcloud/fix-total-upload-size-overwr…
Browse files Browse the repository at this point in the history
…itten-by-next-upload

Fix total upload size overwritten by next upload
  • Loading branch information
rullzer authored Dec 28, 2020
2 parents 4ea1f29 + fc2069c commit 86e6f07
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/files/js/file-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,10 @@ OC.Uploader.prototype = _.extend({
_.each(uploads, function(upload) {
self._uploads[upload.data.uploadId] = upload;
});
self.totalToUpload = _.reduce(uploads, function(memo, upload) { return memo+upload.getFile().size; }, 0);
if (!self._uploading) {
self.totalToUpload = 0;
}
self.totalToUpload += _.reduce(uploads, function(memo, upload) { return memo+upload.getFile().size; }, 0);
var semaphore = new OCA.Files.Semaphore(5);
var promises = _.map(uploads, function(upload) {
return semaphore.acquire().then(function(){
Expand Down

0 comments on commit 86e6f07

Please sign in to comment.