feat(ui): improved dynamic prompts behaviour

- Bump `@invoke-ai/ui` for updated styles
- Update regex to parse prompts with newlines
- Update styling of overlay button when prompt has an error
- Fix bug where loading and error state sometimes weren't cleared
This commit is contained in:
psychedelicious
2024-01-24 07:59:29 +11:00
committed by Kent Keirsey
parent 2aed6e2dba
commit a0e68705dd
7 changed files with 23 additions and 13 deletions

View File

@@ -46,14 +46,14 @@ export const addDynamicPromptsListener = () => {
if (cachedPrompts) {
dispatch(promptsChanged(cachedPrompts.prompts));
dispatch(parsingErrorChanged(cachedPrompts.error));
return;
}
if (!getShouldProcessPrompt(state.generation.positivePrompt)) {
if (state.dynamicPrompts.isLoading) {
dispatch(isLoadingChanged(false));
}
dispatch(promptsChanged([state.generation.positivePrompt]));
dispatch(parsingErrorChanged(undefined));
dispatch(isErrorChanged(false));
return;
}
@@ -78,7 +78,6 @@ export const addDynamicPromptsListener = () => {
dispatch(promptsChanged(res.prompts));
dispatch(parsingErrorChanged(res.error));
dispatch(isErrorChanged(false));
dispatch(isLoadingChanged(false));
} catch {
dispatch(isErrorChanged(true));
dispatch(isLoadingChanged(false));