Remove 'retry' if successful response

This commit is contained in:
Chewbacca 2022-11-07 16:25:53 -05:00
parent 0105458c22
commit f269b754f0

View file

@ -85,8 +85,8 @@ const Chat: React.FC<ChatInterface> = ({ chat, inputRef, className }) => {
queryClient.setQueryData(['chats', 'messages', chat.id], context.prevChatMessages); queryClient.setQueryData(['chats', 'messages', chat.id], context.prevChatMessages);
setErrorSubmittingMessage(true); setErrorSubmittingMessage(true);
}, },
// Always refetch after error or success:
onSuccess: () => { onSuccess: () => {
setErrorSubmittingMessage(false);
queryClient.invalidateQueries(ChatKeys.chatMessages(chat.id)); queryClient.invalidateQueries(ChatKeys.chatMessages(chat.id));
}, },
}); });