зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1392270 - Fix download.estimatedEndTime calculation. r=aswan
MozReview-Commit-ID: HqyYLtTC3N6 --HG-- extra : rebase_source : be06517bd1bee99676a3bedd6fb16f35f82e788b
This commit is contained in:
Родитель
ab399cee7e
Коммит
cbab6d9aea
|
@ -66,8 +66,8 @@ class DownloadItem {
|
|||
// Based on the code in summarizeDownloads() in DownloadsCommon.jsm
|
||||
if (this.download.hasProgress && this.download.speed > 0) {
|
||||
let sizeLeft = this.download.totalBytes - this.download.currentBytes;
|
||||
let rawTimeLeft = sizeLeft / this.download.speed;
|
||||
return new Date(Date.now() + rawTimeLeft);
|
||||
let timeLeftInSeconds = sizeLeft / this.download.speed;
|
||||
return new Date(Date.now() + (timeLeftInSeconds * 1000));
|
||||
}
|
||||
}
|
||||
get state() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче