Skip to content
This repository was archived by the owner on Oct 21, 2020. It is now read-only.

Commit 3e0cb2b

Browse files
committed
fix(download-progress): only calculate ETA when seconds is finite number
1 parent 75f29b7 commit 3e0cb2b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/components/download-progress/component.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,11 @@ export default class DownloadProgressComponent extends Component.extend(
9797
updateProgress(value) {
9898
const delta = value - this.get('value');
9999
const speed = this.speed(delta);
100-
const remaining = 1 - value;
100+
const remaining = Math.max(0, 1 - value);
101101
const seconds = Math.round(remaining / speed);
102-
const eta = moment().add(seconds, 'second').toDate();
102+
const eta = Number.isFinite(seconds)
103+
? moment().add(seconds, 'second').toDate()
104+
: null;
103105
this.setProperties({ value, eta });
104106
}
105107
}

0 commit comments

Comments
 (0)