Skip to content

Commit

Permalink
fix(cli): close animation on error
Browse files Browse the repository at this point in the history
  • Loading branch information
ido-pluto committed Oct 30, 2024
1 parent 55d7b14 commit d13539e
Showing 1 changed file with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,24 @@ export default class CliAnimationWrapper {
return;
}
this._activeCLI.loadingAnimation.start();
const engine = await this._downloadEngine;
this._activeCLI.loadingAnimation.stop();

engine.once("start", () => {
this._activeCLI?.start();
try {
const engine = await this._downloadEngine;
this._activeCLI.loadingAnimation.stop();

engine.on("progress", (progress) => {
this._activeCLI?.updateStatues(engine.downloadStatues, progress);
});
engine.once("start", () => {
this._activeCLI?.start();

engine.on("progress", (progress) => {
this._activeCLI?.updateStatues(engine.downloadStatues, progress);
});

engine.on("closed", () => {
this._activeCLI?.stop();
engine.on("closed", () => {
this._activeCLI?.stop();
});
});
});
} finally {
this._activeCLI.loadingAnimation.stop();
}
}
}

0 comments on commit d13539e

Please sign in to comment.