kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Merge branch 'fix-chats-send' into 'main'
Fix sending chat messages Closes #1752 See merge request soapbox-pub/soapbox!3153environments/review-main-yi2y9f/deployments/4901
commit
a31234e8a1
|
@ -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