mirror of
https://github.com/NovaOSS/nova-betterchat.git
synced 2024-11-25 19:24:00 +01:00
clear error message on new generation
This commit is contained in:
parent
8ba2e473cd
commit
c7504b1038
|
@ -1,4 +1,4 @@
|
|||
import React from 'react';
|
||||
import React, { useEffect } from 'react';
|
||||
import ScrollToBottom from 'react-scroll-to-bottom';
|
||||
import useStore from '@store/store';
|
||||
|
||||
|
@ -29,6 +29,14 @@ const ChatContent = () => {
|
|||
? state.chats[state.currentChatIndex].messages.length
|
||||
: 0
|
||||
);
|
||||
const generating = useStore.getState().generating;
|
||||
|
||||
// clear error at the start of generating new messages
|
||||
useEffect(() => {
|
||||
if (generating) {
|
||||
setError('');
|
||||
}
|
||||
}, [generating]);
|
||||
|
||||
const { handleSubmit, error } = useSubmit();
|
||||
|
||||
|
|
Loading…
Reference in a new issue