chore: switch focus to textarea when custom model change (still need to figure out reg model change)

This commit is contained in:
Daniel Avila 2023-03-15 18:05:34 -04:00
parent ff45511011
commit d052d221dc
3 changed files with 7 additions and 10 deletions

View file

@ -28,7 +28,7 @@ export default function TextChat({ messages }) {
// auto focus to input, when enter a conversation.
useEffect(() => {
inputRef.current?.focus();
}, [convo?.conversationId, ])
}, [convo?.conversationId,])
const messageHandler = (data, currentState, currentMsg) => {
const { messages, _currentMsg, message, sender } = currentState;
@ -185,11 +185,11 @@ export default function TextChat({ messages }) {
sender,
};
console.log('User Input:', message);
// handleSubmit(submission);
dispatch(setSubmission(submission));
};
useEffect(() => {
inputRef.current?.focus();
if (Object.keys(submission).length === 0) {
return;
}