fixed "infinite" transfer speed display

This commit is contained in:
Eugene Pankov
2021-11-06 16:15:09 +01:00
parent f2d6931f1a
commit 59d642434a

View File

@@ -48,6 +48,9 @@ export abstract class FileTransfer {
}
protected increaseProgress (bytes: number): void {
if (!bytes) {
return
}
this.completedBytes += bytes
this.lastChunkSpeed = bytes * 1000 / (Date.now() - this.lastChunkStartTime)
this.lastChunkStartTime = Date.now()