mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-21 19:00:13 +01:00
feat: gen title by sperate api call
feat: fix: rename of convo should based on real request.
This commit is contained in:
parent
8773878be2
commit
9f8e9cb091
8 changed files with 65 additions and 28 deletions
|
|
@ -8,13 +8,14 @@ import { setMessages, setEmptyMessage } from '~/store/messageSlice';
|
|||
import { setText } from '~/store/textSlice';
|
||||
import manualSWR from '~/utils/fetchers';
|
||||
import ConvoIcon from '../svg/ConvoIcon';
|
||||
import { refreshConversation } from '../../store/convoSlice';
|
||||
|
||||
export default function Conversation({
|
||||
id,
|
||||
model,
|
||||
parentMessageId,
|
||||
conversationId,
|
||||
title = 'New conversation',
|
||||
title,
|
||||
chatGptLabel = null,
|
||||
promptPrefix = null,
|
||||
bingData,
|
||||
|
|
@ -95,6 +96,7 @@ export default function Conversation({
|
|||
|
||||
const renameHandler = (e) => {
|
||||
e.preventDefault();
|
||||
setTitleInput(title);
|
||||
setRenaming(true);
|
||||
setTimeout(() => {
|
||||
inputRef.current.focus();
|
||||
|
|
@ -112,7 +114,10 @@ export default function Conversation({
|
|||
if (titleInput === title) {
|
||||
return;
|
||||
}
|
||||
rename.trigger({ conversationId, title: titleInput });
|
||||
rename.trigger({ conversationId, title: titleInput })
|
||||
.then(() => {
|
||||
dispatch(refreshConversation())
|
||||
});
|
||||
};
|
||||
|
||||
const handleKeyDown = (e) => {
|
||||
|
|
@ -149,7 +154,7 @@ export default function Conversation({
|
|||
onKeyDown={handleKeyDown}
|
||||
/>
|
||||
) : (
|
||||
titleInput
|
||||
title
|
||||
)}
|
||||
</div>
|
||||
{conversationId === id ? (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue