mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-18 16:35:31 +01:00
refactor convos fetching to nav components, results in faster loading
This commit is contained in:
parent
e4d1ff2523
commit
742073fb89
8 changed files with 389 additions and 286 deletions
|
|
@ -5,15 +5,11 @@ import TextChat from './components/main/TextChat';
|
|||
import Nav from './components/Nav';
|
||||
import MobileNav from './components/Nav/MobileNav';
|
||||
import useDocumentTitle from '~/hooks/useDocumentTitle';
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
import { setConvos } from '~/store/convoSlice';
|
||||
import { useSelector } from 'react-redux';
|
||||
|
||||
const App = () => {
|
||||
const { messages } = useSelector((state) => state.messages);
|
||||
const { title } = useSelector((state) => state.convo);
|
||||
const dispatch = useDispatch();
|
||||
const { data, error, isLoading, mutate } = swr('http://localhost:3050/convos', (res) => dispatch(setConvos(res)));
|
||||
|
||||
useDocumentTitle(title);
|
||||
|
||||
return (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue