companion: overwrite bytestotal for only tus uploads

This commit is contained in:
Ifedapo Olarewaju 2019-04-04 10:35:28 +01:00
parent 1d4c9a5720
commit d9ec8d28f4

View file

@ -225,7 +225,7 @@ class Uploader {
*/
emitProgress (bytesUploaded, bytesTotal) {
bytesTotal = bytesTotal || this.options.size
if (this.tus.options.uploadLengthDeferred && this.streamsEnded) {
if (this.tus && this.tus.options.uploadLengthDeferred && this.streamsEnded) {
bytesTotal = this.bytesWritten
}
const percentage = (bytesUploaded / bytesTotal * 100)