mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-21 19:00:13 +01:00
add delete conversation mutation, fix withAuthentication on post requests
This commit is contained in:
parent
bd53b878d4
commit
94e0636b32
5 changed files with 68 additions and 49 deletions
|
|
@ -61,30 +61,20 @@ export default function Conversation({ conversation, retainView }) {
|
|||
if (titleInput === title) {
|
||||
return;
|
||||
}
|
||||
updateConvoMutation.mutate({ arg: { conversationId, title: titleInput }});
|
||||
|
||||
// rename.trigger({ conversationId, title: titleInput }).then(() => {
|
||||
// refreshConversations();
|
||||
// if (conversationId == currentConversation?.conversationId)
|
||||
// setCurrentConversation(prevState => ({
|
||||
// ...prevState,
|
||||
// title: titleInput
|
||||
// }));
|
||||
// });
|
||||
updateConvoMutation.mutate({ conversationId, title: titleInput });
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (updateConvoMutation.isSuccess) {
|
||||
// debugger;
|
||||
refreshConversations();
|
||||
if (conversationId == currentConversation?.conversationId)
|
||||
|
||||
setCurrentConversation(prevState => ({
|
||||
...prevState,
|
||||
title: titleInput
|
||||
}));
|
||||
}
|
||||
}, [updateConvoMutation.isSuccess]);
|
||||
if (updateConvoMutation.isSuccess) {
|
||||
refreshConversations();
|
||||
if (conversationId == currentConversation?.conversationId) {
|
||||
setCurrentConversation(prevState => ({
|
||||
...prevState,
|
||||
title: titleInput
|
||||
}));
|
||||
}
|
||||
}
|
||||
}, [updateConvoMutation.isSuccess]);
|
||||
|
||||
const handleKeyDown = e => {
|
||||
if (e.key === 'Enter') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue