From 2ecf837656442db174df8d8d61383a8aab384ef6 Mon Sep 17 00:00:00 2001 From: Chewbacca Date: Fri, 4 Nov 2022 09:49:35 -0400 Subject: [PATCH] Remove changing of screen when updating a chat --- app/soapbox/queries/chats.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/soapbox/queries/chats.ts b/app/soapbox/queries/chats.ts index 945cb76c6..d9a2b70bf 100644 --- a/app/soapbox/queries/chats.ts +++ b/app/soapbox/queries/chats.ts @@ -244,8 +244,6 @@ const useChatActions = (chatId: string) => { // Optimistically update to the new value queryClient.setQueryData(ChatKeys.chat(chatId), nextChat); - changeScreen(ChatWidgetScreens.CHAT, nextChat.id); - // Return a context object with the snapshotted value return { prevChat }; }, @@ -255,10 +253,9 @@ const useChatActions = (chatId: string) => { queryClient.setQueryData(ChatKeys.chat(chatId), context.prevChat); dispatch(snackbar.error('Chat Settings failed to update.')); }, - onSuccess(response) { + onSuccess() { queryClient.invalidateQueries(ChatKeys.chat(chatId)); queryClient.invalidateQueries(ChatKeys.chatSearch()); - changeScreen(ChatWidgetScreens.CHAT, response.data.id); dispatch(snackbar.success('Chat Settings updated successfully')); }, });