Invalid individual Chat query on chat acceptance

This commit is contained in:
Chewbacca 2022-11-04 07:37:05 -04:00
parent 472df260fe
commit 8d99cfd24f

View file

@ -268,6 +268,7 @@ const useChatActions = (chatId: string) => {
const acceptChat = useMutation(() => api.post<IChat>(`/api/v1/pleroma/chats/${chatId}/accept`), { const acceptChat = useMutation(() => api.post<IChat>(`/api/v1/pleroma/chats/${chatId}/accept`), {
onSuccess(response) { onSuccess(response) {
changeScreen(ChatWidgetScreens.CHAT, response.data.id); changeScreen(ChatWidgetScreens.CHAT, response.data.id);
queryClient.invalidateQueries(ChatKeys.chat(chatId));
queryClient.invalidateQueries(ChatKeys.chatMessages(chatId)); queryClient.invalidateQueries(ChatKeys.chatMessages(chatId));
queryClient.invalidateQueries(ChatKeys.chatSearch()); queryClient.invalidateQueries(ChatKeys.chatSearch());
}, },