mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2026-04-18 15:22:16 +00:00
Round progress to 4th digit to prevent weird progress bar behavior on reconnect
This commit is contained in:
@@ -890,8 +890,9 @@ class Peer {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// While transferring -> round progress to 4th digit. After transferring, set it to 1.
|
||||||
let progress = this._digester
|
let progress = this._digester
|
||||||
? (this._totalBytesReceived + this._digester._bytesReceived) / this._acceptedRequest.totalSize
|
? Math.floor(1e4 * (this._totalBytesReceived + this._digester._bytesReceived) / this._acceptedRequest.totalSize) / 1e4
|
||||||
: 1;
|
: 1;
|
||||||
|
|
||||||
Events.fire('set-progress', {peerId: this._peerId, progress: progress, status: 'receive'});
|
Events.fire('set-progress', {peerId: this._peerId, progress: progress, status: 'receive'});
|
||||||
|
|||||||
Reference in New Issue
Block a user