mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-31 15:48:51 +01:00
fix: use new conversation Id
This commit is contained in:
parent
017447b064
commit
3b94a98719
4 changed files with 120 additions and 89 deletions
|
|
@ -2,6 +2,7 @@ import endpoints from './endpoints';
|
|||
import { atom, selector, useSetRecoilState, useResetRecoilState, useRecoilCallback } from 'recoil';
|
||||
import buildTree from '~/utils/buildTree';
|
||||
import getDefaultConversation from '~/utils/getDefaultConversation';
|
||||
import submission from './submission.js';
|
||||
|
||||
// current conversation, can be null (need to be fetched from server)
|
||||
// sample structure
|
||||
|
|
@ -59,6 +60,7 @@ const latestMessage = atom({
|
|||
const useConversation = () => {
|
||||
const setConversation = useSetRecoilState(conversation);
|
||||
const setMessages = useSetRecoilState(messages);
|
||||
const setSubmission = useSetRecoilState(submission.submission);
|
||||
const resetLatestMessage = useResetRecoilState(latestMessage);
|
||||
|
||||
const switchToConversation = useRecoilCallback(
|
||||
|
|
@ -93,6 +95,7 @@ const useConversation = () => {
|
|||
|
||||
setConversation(conversation);
|
||||
setMessages(messages);
|
||||
setSubmission({});
|
||||
resetLatestMessage();
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue