Skip to content
Permalink
Browse files

fix(download-progress): only calculate ETA when seconds is finite number

  • Loading branch information...
devinus committed Jan 28, 2019
1 parent 75f29b7 commit 3e0cb2b862474bb85802a0408a424a42bc3846f1
Showing with 4 additions and 2 deletions.
  1. +4 −2 app/components/download-progress/component.js
@@ -97,9 +97,11 @@ export default class DownloadProgressComponent extends Component.extend(
updateProgress(value) {
const delta = value - this.get('value');
const speed = this.speed(delta);
const remaining = 1 - value;
const remaining = Math.max(0, 1 - value);
const seconds = Math.round(remaining / speed);
const eta = moment().add(seconds, 'second').toDate();
const eta = Number.isFinite(seconds)
? moment().add(seconds, 'second').toDate()
: null;
this.setProperties({ value, eta });
}
}

0 comments on commit 3e0cb2b

Please sign in to comment.
You can’t perform that action at this time.