Переглянути джерело

core: set bytesUploaded/bytesTotal as soon as the file is added

This fixes an issue with the upload ETA sometimes being `NaN`. These
properties would be undefined when some files did not yet emit progress
events, blowing up the ETA calculation.
Renée Kooi 7 роки тому
батько
коміт
e218cf0f4a
1 змінених файлів з 2 додано та 0 видалено
  1. 2 0
      src/core/Core.js

+ 2 - 0
src/core/Core.js

@@ -169,6 +169,8 @@ class Uppy {
         data: file.data,
         data: file.data,
         progress: {
         progress: {
           percentage: 0,
           percentage: 0,
+          bytesUploaded: 0,
+          bytesTotal: file.data.size || 0,
           uploadComplete: false,
           uploadComplete: false,
           uploadStarted: false
           uploadStarted: false
         },
         },