mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-05 18:18:51 +01:00
debugging convo state, useSWR now within convos component
This commit is contained in:
parent
0e5c7c7721
commit
dcf4f2a524
6 changed files with 213 additions and 15 deletions
|
|
@ -4,26 +4,20 @@ import Messages from './components/main/Messages';
|
|||
import TextChat from './components/main/TextChat';
|
||||
import Nav from './components/Nav';
|
||||
import MobileNav from './components/Nav/MobileNav';
|
||||
import { swr } from './utils/fetchers';
|
||||
import useDidMountEffect from './hooks/useDidMountEffect';
|
||||
|
||||
const App = () => {
|
||||
const { messages } = useSelector((state) => state.messages);
|
||||
const { conversationId } = useSelector((state) => state.convo);
|
||||
const { title } = useSelector((state) => state.convo);
|
||||
const { data, error, isLoading, mutate } = swr('http://localhost:3050/convos');
|
||||
useDidMountEffect(() => mutate(), [conversationId]);
|
||||
|
||||
return (
|
||||
<div className="flex h-screen">
|
||||
<Nav conversations={data} />
|
||||
<Nav />
|
||||
<div className="flex h-full w-full flex-1 flex-col bg-gray-50 md:pl-[260px]">
|
||||
<div className="transition-width relative flex h-full w-full flex-1 flex-col items-stretch overflow-hidden dark:bg-gray-800">
|
||||
<MobileNav />
|
||||
<Messages messages={messages} title={title}/>
|
||||
<TextChat
|
||||
messages={messages}
|
||||
reloadConvos={mutate}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue