Merge pull request #24854 from nextcloud/backport/24833/stable20
[stable20] Fix total upload size overwritten by next upload
This commit is contained in:
commit
d96555c413
|
@ -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(){
|
||||||
|
|
Loading…
Reference in New Issue