summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2020-12-28 11:18:48 +0100
committerGitHub <noreply@github.com>2020-12-28 11:18:48 +0100
commit86e6f0716203c9fa1032b6fa6484b5b935d61a6e (patch)
tree5173d866194a1075931489ebd9e08b2bb2605abf
parent4ea1f29f9c456075ca3dc58962032e0376b99b4e (diff)
parentfc2069c1dd44698cfeba48b18139041a2fb6a1d5 (diff)
downloadnextcloud-server-86e6f0716203c9fa1032b6fa6484b5b935d61a6e.tar.gz
nextcloud-server-86e6f0716203c9fa1032b6fa6484b5b935d61a6e.zip
Merge pull request #24833 from nextcloud/fix-total-upload-size-overwritten-by-next-upload
Fix total upload size overwritten by next upload
-rw-r--r--apps/files/js/file-upload.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js
index 3c0ca319225..178cda856a6 100644
--- a/apps/files/js/file-upload.js
+++ b/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(){