mirror of
https://github.com/cosmicoptima/loom.git
synced 2026-07-22 07:40:25 +00:00
remove generating loader if generation fails
This commit is contained in:
parent
382ca9ac78
commit
7c4e22fe76
1 changed files with 8 additions and 0 deletions
8
main.ts
8
main.ts
|
|
@ -1287,10 +1287,18 @@ export default class LoomPlugin extends Plugin {
|
|||
result = await completionMethods[getPreset(this.settings).provider].bind(this)(prompt);
|
||||
} catch (e) {
|
||||
new Notice(`Error: ${e}`);
|
||||
this.state[file.path].generating = null;
|
||||
this.saveAndRender();
|
||||
this.statusBarItem.style.display = "none";
|
||||
|
||||
return;
|
||||
}
|
||||
if (!result.ok) {
|
||||
new Notice(`Error ${result.status}: ${result.message}`);
|
||||
this.state[file.path].generating = null;
|
||||
this.saveAndRender();
|
||||
this.statusBarItem.style.display = "none";
|
||||
|
||||
return;
|
||||
}
|
||||
const rawCompletions = result.completions;
|
||||
|
|
|
|||
Loading…
Reference in a new issue