fix(ui): clear pending trigger phrase immediately

If we don't clear it, there's an awkward flash of error state as the mutation completes.
This commit is contained in:
psychedelicious 2024-03-07 18:56:44 +11:00
parent fe8e391aad
commit 4077dfe0c3

View File

@ -56,11 +56,12 @@ export const TriggerPhrases = () => {
return;
}
setPhrase('');
await updateModel({
key: selectedModelKey,
body: { trigger_phrases: [...triggerPhrases, phrase] },
}).unwrap();
setPhrase('');
}, [updateModel, selectedModelKey, phrase, triggerPhrases]);
const removeTriggerPhrase = useCallback(