mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-26 12:16:13 +01:00
rearrange convo fetching for performance in progress
This commit is contained in:
parent
c00a2c902b
commit
e4d1ff2523
5 changed files with 21 additions and 8 deletions
|
|
@ -1,16 +1,13 @@
|
|||
import React, { useState } from 'react';
|
||||
import { useSelector } from 'react-redux';
|
||||
import Conversation from './Conversation';
|
||||
import { swr } from '~/utils/fetchers';
|
||||
// import { swr } from '~/utils/fetchers';
|
||||
import useDidMountEffect from '~/hooks/useDidMountEffect';
|
||||
|
||||
export default function Conversations() {
|
||||
const { data, error, isLoading, mutate } = swr('http://localhost:3050/convos');
|
||||
const conversations = data;
|
||||
const [isHovering, setIsHovering] = useState(false);
|
||||
const { conversationId } = useSelector((state) => state.convo);
|
||||
|
||||
useDidMountEffect(() => mutate(), [conversationId]);
|
||||
// useDidMountEffect(() => mutate(), [conversationId]);
|
||||
// const currentRef = useRef(null);
|
||||
|
||||
// const scrollToTop = () => {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import Conversations from '../Conversations';
|
|||
import NavLinks from './NavLinks';
|
||||
|
||||
export default function Nav() {
|
||||
const { conversationId } = useSelector((state) => state.convo);
|
||||
|
||||
return (
|
||||
<div className="dark hidden bg-gray-900 md:fixed md:inset-y-0 md:flex md:w-[260px] md:flex-col">
|
||||
<div className="flex h-full min-h-0 flex-col ">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue