mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-27 04:36:12 +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,9 +1,11 @@
|
|||
import React, { useEffect, useRef } from 'react';
|
||||
import { useSelector } from 'react-redux';
|
||||
import useDocumentTitle from '~/hooks/useDocumentTitle';
|
||||
import useDidMountEffect from '~/hooks/useDidMountEffect';
|
||||
import Message from './Message';
|
||||
import Landing from './Landing';
|
||||
|
||||
export default function Messages({ messages, title }) {
|
||||
export default function Messages({ title, messages }) {
|
||||
if (messages.length === 0) {
|
||||
return <Landing title={title}/>;
|
||||
}
|
||||
|
|
@ -18,9 +20,11 @@ export default function Messages({ messages, title }) {
|
|||
|
||||
// this useEffect triggers the following warning:
|
||||
// Warning: Internal React error: Expected static flag was missing.
|
||||
useEffect(() => {
|
||||
scrollToBottom();
|
||||
}, [messages]);
|
||||
// useEffect(() => {
|
||||
// scrollToBottom();
|
||||
// }, [messages]);
|
||||
|
||||
useDidMountEffect(() => scrollToBottom(), [messages]);
|
||||
|
||||
return (
|
||||
<div className="flex-1 overflow-y-auto ">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue