This commit is contained in:
Chewbacca 2022-11-11 08:01:17 -05:00
parent b364af645f
commit ecc67737c6

View file

@ -36,13 +36,15 @@ const Chat: React.FC<ChatInterface> = ({ chat, inputRef, className }) => {
const submitMessage = () => { const submitMessage = () => {
createChatMessage.mutate({ chatId: chat.id, content }, { createChatMessage.mutate({ chatId: chat.id, content }, {
onError: (_error, _variables, context: any) => {
setContent(context.prevContent as string);
setErrorSubmittingMessage(true);
},
onSuccess: () => { onSuccess: () => {
setErrorSubmittingMessage(false); setErrorSubmittingMessage(false);
}, },
onError: (error, _variables, context: any) => {
console.log(context);
setContent(context.prevContent as string);
setErrorSubmittingMessage(true);
},
}); });
clearState(); clearState();