Merge pull request #24855 from nextcloud/backport/24833/stable19

[stable19] Fix total upload size overwritten by next upload
This commit is contained in:
Roeland Jago Douma 2020-12-28 14:17:02 +01:00 committed by GitHub
commit e1a1854753
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -586,7 +586,10 @@ OC.Uploader.prototype = _.extend({
_.each(uploads, function(upload) { _.each(uploads, function(upload) {
self._uploads[upload.data.uploadId] = 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 semaphore = new OCA.Files.Semaphore(5);
var promises = _.map(uploads, function(upload) { var promises = _.map(uploads, function(upload) {
return semaphore.acquire().then(function(){ return semaphore.acquire().then(function(){