mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-11 20:14:24 +01:00
fix: fix infinite query failure when conversationId is not found
This commit is contained in:
parent
478814ff1b
commit
fb7542c865
2 changed files with 12 additions and 13 deletions
|
|
@ -63,13 +63,11 @@ export const useGetConversationByIdQuery = (
|
|||
//to make it work with how the Chat component is structured
|
||||
export const useGetConversationByIdMutation = (
|
||||
id: string,
|
||||
callback: (data: t.TConversation) => void
|
||||
): UseMutationResult<t.TConversation> => {
|
||||
const queryClient = useQueryClient();
|
||||
return useMutation(() => dataService.getConversationById(id),
|
||||
{
|
||||
onSuccess: (res: t.TConversation) => {
|
||||
callback(res);
|
||||
queryClient.invalidateQueries([QueryKeys.conversation, id]);
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue