Made the app not hang when a mod is not found

This commit is contained in:
Kallum Jones 2022-08-04 01:14:21 +01:00
parent 1af3292e8c
commit 3b229070a9
No known key found for this signature in database
GPG Key ID: D7F4589C4D7F81A9
2 changed files with 4 additions and 3 deletions

View File

@ -30,7 +30,7 @@ export default class Mods {
id = await source.search(mod); id = await source.search(mod);
} catch (e) { } catch (e) {
if (e instanceof ModNotFoundError) { if (e instanceof ModNotFoundError) {
spinner.updateText(`Mod not found on ${source.getSourceName()}`) spinner.stop(`Mod not found on ${source.getSourceName()}`)
} else { } else {
spinner.error(`An error occurred searching for ${mod} on ${source.getSourceName()}. Skipping ${source.getSourceName()}`) spinner.error(`An error occurred searching for ${mod} on ${source.getSourceName()}. Skipping ${source.getSourceName()}`)
// Try the next source // Try the next source

View File

@ -19,8 +19,9 @@ export default class PrintUtils {
this.spinner.start(); this.spinner.start();
} }
public stop() { public stop(print: string) {
this.spinner.stop(); this.updateText(print);
this.spinner.stopAndPersist();
} }
public error(print: string | Error) { public error(print: string | Error) {