mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
🎨 feat: Title Improvements (#2363)
* fix(assistants): keep generated title upon continued messages in active conversation * feat: update document.title on successful gentitle mutation
This commit is contained in:
parent
6f0eb35365
commit
cc71125fa1
4 changed files with 10 additions and 4 deletions
|
|
@ -192,10 +192,19 @@ export default function useSSE(submission: TSubmission | null, index = 0) {
|
|||
|
||||
let update = {} as TConversation;
|
||||
setConversation((prevState) => {
|
||||
let title = prevState?.title;
|
||||
const parentId = requestMessage.parentMessageId;
|
||||
if (parentId !== Constants.NO_PARENT && title?.toLowerCase()?.includes('new chat')) {
|
||||
const convos = queryClient.getQueryData<ConversationData>([QueryKeys.allConversations]);
|
||||
const cachedConvo = getConversationById(convos, conversationId);
|
||||
title = cachedConvo?.title;
|
||||
}
|
||||
|
||||
update = tConvoUpdateSchema.parse({
|
||||
...prevState,
|
||||
conversationId,
|
||||
thread_id,
|
||||
title,
|
||||
messages: [requestMessage.messageId, responseMessage.messageId],
|
||||
}) as TConversation;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue