Explorar el Código

companion: assume higher size when size is uncertain

Ifedapo Olarewaju hace 6 años
padre
commit
a082555e53
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      packages/@uppy/companion/src/server/Uploader.js

+ 4 - 1
packages/@uppy/companion/src/server/Uploader.js

@@ -249,7 +249,10 @@ class Uploader {
       return
     }
 
-    const bytesTotal = this.streamsEnded ? this.bytesWritten : this.options.size
+    let bytesTotal = this.streamsEnded ? this.bytesWritten : this.options.size
+    if (!this.streamsEnded) {
+      bytesTotal = Math.max(bytesTotal, this.bytesWritten)
+    }
     bytesUploaded = bytesUploaded || 0
     // for a 10MB file, 10MB of download will account for 5MB upload progress
     // and 10MB of actual upload will account for the other 5MB upload progress.