mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-20 23:16:13 -04:00
Round progress to 4th digit to prevent weird progress bar behavior on reconnect
This commit is contained in:
parent
3c8848d406
commit
00f1a20177
1 changed files with 2 additions and 1 deletions
|
@ -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'});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue