From 3b229070a9f407fc7fc83da570d8357bf5a090af Mon Sep 17 00:00:00 2001 From: Kallum Jones Date: Thu, 4 Aug 2022 01:14:21 +0100 Subject: [PATCH] Made the app not hang when a mod is not found --- src/mods/mods.ts | 2 +- src/util/print_utils.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mods/mods.ts b/src/mods/mods.ts index 4653922..9bb24e0 100644 --- a/src/mods/mods.ts +++ b/src/mods/mods.ts @@ -30,7 +30,7 @@ export default class Mods { id = await source.search(mod); } catch (e) { if (e instanceof ModNotFoundError) { - spinner.updateText(`Mod not found on ${source.getSourceName()}`) + spinner.stop(`Mod not found on ${source.getSourceName()}`) } else { spinner.error(`An error occurred searching for ${mod} on ${source.getSourceName()}. Skipping ${source.getSourceName()}`) // Try the next source diff --git a/src/util/print_utils.ts b/src/util/print_utils.ts index cabc4e5..80982c0 100644 --- a/src/util/print_utils.ts +++ b/src/util/print_utils.ts @@ -19,8 +19,9 @@ export default class PrintUtils { this.spinner.start(); } - public stop() { - this.spinner.stop(); + public stop(print: string) { + this.updateText(print); + this.spinner.stopAndPersist(); } public error(print: string | Error) {