kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Fix sending chat messages
Fixes https://gitlab.com/soapbox-pub/soapbox/-/issues/1752environments/review-fix-chats-g3m4o9/deployments/4900
rodzic
d2ff5cf64e
commit
5f9cede2ac
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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(
|
||||
|
|
Ładowanie…
Reference in New Issue