fix: 🐛 handle trigger phrase form submits

This commit is contained in:
Josh Corbett 2024-04-21 23:18:23 -06:00 committed by psychedelicious
parent 8b9c4c62a6
commit 28c28b2fc0

View File

@ -77,9 +77,17 @@ export const TriggerPhrases = () => {
[updateModel, selectedModelKey, triggerPhrases] [updateModel, selectedModelKey, triggerPhrases]
); );
const onTriggerPhraseAddFormSubmit = useCallback(
(e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
addTriggerPhrase();
},
[addTriggerPhrase]
);
return ( return (
<Flex flexDir="column" w="full" gap="5"> <Flex flexDir="column" w="full" gap="5">
<form> <form onSubmit={onTriggerPhraseAddFormSubmit}>
<FormControl w="full" isInvalid={Boolean(errors.length)} orientation="vertical"> <FormControl w="full" isInvalid={Boolean(errors.length)} orientation="vertical">
<FormLabel>{t('modelManager.triggerPhrases')}</FormLabel> <FormLabel>{t('modelManager.triggerPhrases')}</FormLabel>
<Flex flexDir="column" w="full"> <Flex flexDir="column" w="full">