Преглед на файлове

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,
         progress: {
           percentage: 0,
+          bytesUploaded: 0,
+          bytesTotal: file.data.size || 0,
           uploadComplete: false,
           uploadStarted: false
         },