Rely on startNext to invoke maybeNotifyFinished

Closes #6
This commit is contained in:
Nils Maier 2019-08-24 06:34:37 +02:00
parent 545d78ad61
commit 7bfffd7598

View File

@ -266,7 +266,6 @@ export class Manager extends EventEmitter {
changedState(download: Download, oldState: number, newState: number) {
if (oldState === RUNNING) {
this.running.delete(download);
this.maybeNotifyFinished();
}
if (newState === QUEUED) {
this.resetScheduler();
@ -279,7 +278,7 @@ export class Manager extends EventEmitter {
this.running.add(download);
}
else {
this.startNext();
this.startNext().catch(console.error);
}
}