chore(downloader): optimize aborted style

This commit is contained in:
iyear 2022-09-15 14:54:18 +08:00
parent db72b0b274
commit e1e4ae4986

View file

@ -64,14 +64,14 @@ func (d *Downloader) Download(ctx context.Context, limit int) error {
err := wg.Wait() err := wg.Wait()
if err != nil { if err != nil {
if errors.Is(err, context.Canceled) {
d.pw.Log(color.RedString("Download aborted."))
}
d.pw.Stop() d.pw.Stop()
for d.pw.IsRenderInProgress() { for d.pw.IsRenderInProgress() {
time.Sleep(time.Millisecond * 10) time.Sleep(time.Millisecond * 10)
} }
if errors.Is(err, context.Canceled) {
color.Red("Download aborted.")
}
return err return err
} }