diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2020-12-28 11:18:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-28 11:18:48 +0100 |
commit | 86e6f0716203c9fa1032b6fa6484b5b935d61a6e (patch) | |
tree | 5173d866194a1075931489ebd9e08b2bb2605abf | |
parent | 4ea1f29f9c456075ca3dc58962032e0376b99b4e (diff) | |
parent | fc2069c1dd44698cfeba48b18139041a2fb6a1d5 (diff) | |
download | nextcloud-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.js | 5 |
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(){ |