Remove changing of screen when updating a chat
This commit is contained in:
parent
4408c6035f
commit
2ecf837656
1 changed files with 1 additions and 4 deletions
|
@ -244,8 +244,6 @@ const useChatActions = (chatId: string) => {
|
||||||
// Optimistically update to the new value
|
// Optimistically update to the new value
|
||||||
queryClient.setQueryData(ChatKeys.chat(chatId), nextChat);
|
queryClient.setQueryData(ChatKeys.chat(chatId), nextChat);
|
||||||
|
|
||||||
changeScreen(ChatWidgetScreens.CHAT, nextChat.id);
|
|
||||||
|
|
||||||
// Return a context object with the snapshotted value
|
// Return a context object with the snapshotted value
|
||||||
return { prevChat };
|
return { prevChat };
|
||||||
},
|
},
|
||||||
|
@ -255,10 +253,9 @@ const useChatActions = (chatId: string) => {
|
||||||
queryClient.setQueryData(ChatKeys.chat(chatId), context.prevChat);
|
queryClient.setQueryData(ChatKeys.chat(chatId), context.prevChat);
|
||||||
dispatch(snackbar.error('Chat Settings failed to update.'));
|
dispatch(snackbar.error('Chat Settings failed to update.'));
|
||||||
},
|
},
|
||||||
onSuccess(response) {
|
onSuccess() {
|
||||||
queryClient.invalidateQueries(ChatKeys.chat(chatId));
|
queryClient.invalidateQueries(ChatKeys.chat(chatId));
|
||||||
queryClient.invalidateQueries(ChatKeys.chatSearch());
|
queryClient.invalidateQueries(ChatKeys.chatSearch());
|
||||||
changeScreen(ChatWidgetScreens.CHAT, response.data.id);
|
|
||||||
dispatch(snackbar.success('Chat Settings updated successfully'));
|
dispatch(snackbar.success('Chat Settings updated successfully'));
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue