Fix sending chat messages

Fixes https://gitlab.com/soapbox-pub/soapbox/-/issues/1752
environments/review-fix-chats-g3m4o9/deployments/4900
Alex Gleason 2024-10-13 13:42:21 -05:00
rodzic d2ff5cf64e
commit 5f9cede2ac
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
2 zmienionych plików z 2 dodań i 3 usunięć

Wyświetl plik

@ -96,7 +96,7 @@ const Chat: React.FC<ChatInterface> = ({ chat, inputRef, className }) => {
if (!isSubmitDisabled && !createChatMessage.isPending) {
submitMessage();
if (!chat.accepted) {
if (chat.accepted === false) {
acceptChat.mutate();
}
}

Wyświetl plik

@ -294,8 +294,7 @@ const useChatActions = (chatId: string) => {
onError: (_error: any, variables, context: any) => {
queryClient.setQueryData(['chats', 'messages', variables.chatId], context.prevChatMessages);
},
onSuccess: async (response, variables, context) => {
const data = await response.json();
onSuccess: (data, variables, context) => {
const nextChat = { ...chat, last_message: data };
updatePageItem(ChatKeys.chatSearch(), nextChat, (o, n) => o.id === n.id);
updatePageItem(