Просмотр исходного кода

Set `bytesUploaded = bytesTotal`

as discussed in https://github.com/transloadit/uppy/issues/530 //cc @goto-bus-stop
Artur Paikin 6 лет назад
Родитель
Сommit
ec8e207ae5
1 измененных файлов с 4 добавлено и 2 удалено
  1. 4 2
      src/core/Core.js

+ 4 - 2
src/core/Core.js

@@ -698,10 +698,12 @@ class Uppy {
     this.on('upload-progress', _throttledCalculateProgress)
 
     this.on('upload-success', (file, uploadResp, uploadURL) => {
+      const currentProgress = this.getFile(file.id).progress
       this.setFileState(file.id, {
-        progress: Object.assign({}, this.getFile(file.id).progress, {
+        progress: Object.assign({}, currentProgress, {
           uploadComplete: true,
-          percentage: 100
+          percentage: 100,
+          bytesUploaded: currentProgress.bytesTotal
         }),
         uploadURL: uploadURL,
         isPaused: false