mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 01:10:14 +01:00
fix: convos correctly delete
This commit is contained in:
parent
17c01aa252
commit
f2b092545f
8 changed files with 28 additions and 19 deletions
|
|
@ -3,7 +3,7 @@ import TrashIcon from '../svg/TrashIcon';
|
|||
import CrossIcon from '../svg/CrossIcon';
|
||||
import manualSWR from '~/utils/fetchers';
|
||||
import { useDispatch } from 'react-redux';
|
||||
import { setConversation } from '~/store/convoSlice';
|
||||
import { setConversation, removeConvo } from '~/store/convoSlice';
|
||||
import { setMessages } from '~/store/messageSlice';
|
||||
|
||||
export default function DeleteButton({ conversationId, renaming, cancelHandler }) {
|
||||
|
|
@ -13,6 +13,7 @@ export default function DeleteButton({ conversationId, renaming, cancelHandler }
|
|||
'post',
|
||||
() => {
|
||||
dispatch(setMessages([]));
|
||||
dispatch(removeConvo(conversationId));
|
||||
dispatch(setConversation({ title: 'New chat', conversationId: null, parentMessageId: null }));
|
||||
}
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue