Merge pull request #24833 from nextcloud/fix-total-upload-size-overwritten-by-next-upload

Fix total upload size overwritten by next upload
pull/24856/head
Roeland Jago Douma 4 years ago committed by GitHub
commit 86e6f07162
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      apps/files/js/file-upload.js

@ -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(){

Loading…
Cancel
Save