Selaa lähdekoodia

companion: assume higher size when size is uncertain

Ifedapo Olarewaju 6 vuotta sitten
vanhempi
commit
a082555e53
1 muutettua tiedostoa jossa 4 lisäystä ja 1 poistoa
  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.