Browse Source

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 years ago
parent
commit
e218cf0f4a
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/core/Core.js

+ 2 - 0
src/core/Core.js

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