mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-27 05:38:51 +01:00
refactors server route for brevity, state working, styling matching to chatgpt
This commit is contained in:
parent
dcf4f2a524
commit
acaef39d12
10 changed files with 75 additions and 53 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import React from 'react';
|
||||
import TrashIcon from '../svg/TrashIcon';
|
||||
import { useSWRConfig } from "swr"
|
||||
import manualSWR from '~/utils/fetchers';
|
||||
import { useDispatch } from 'react-redux';
|
||||
import { setConversation } from '~/store/convoSlice';
|
||||
|
|
@ -7,6 +8,7 @@ import { setMessages } from '~/store/messageSlice';
|
|||
|
||||
export default function ClearConvos() {
|
||||
const dispatch = useDispatch();
|
||||
const { mutate } = useSWRConfig()
|
||||
|
||||
const { trigger, isMutating } = manualSWR(
|
||||
'http://localhost:3050/convos/clear',
|
||||
|
|
@ -14,6 +16,7 @@ export default function ClearConvos() {
|
|||
() => {
|
||||
dispatch(setMessages([]));
|
||||
dispatch(setConversation({ error: false, conversationId: null, parentMessageId: null }));
|
||||
mutate('http://localhost:3050/convos');
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue