mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-20 10:20:15 +01:00
feat: support resubmit.
TODO: basic implementation. should add multi-path record in future. feat: add deleteMessahesSince feat: saveMessage will do createOrSave feat: reorginazed submission
This commit is contained in:
parent
b9975ac283
commit
bdfc895800
10 changed files with 189 additions and 67 deletions
|
|
@ -4,10 +4,12 @@ import ScrollToBottom from './ScrollToBottom';
|
|||
import Message from './Message';
|
||||
|
||||
const Messages = ({ messages }) => {
|
||||
const [currentEditIdx, setCurrentEditIdx] = useState(-1)
|
||||
const [showScrollButton, setShowScrollButton] = useState(false);
|
||||
const scrollableRef = useRef(null);
|
||||
const messagesEndRef = useRef(null);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
const timeoutId = setTimeout(() => {
|
||||
const scrollable = scrollableRef.current;
|
||||
|
|
@ -60,11 +62,13 @@ const Messages = ({ messages }) => {
|
|||
{messages.map((message, i) => (
|
||||
<Message
|
||||
key={i}
|
||||
sender={message.sender}
|
||||
text={message.text}
|
||||
message={message}
|
||||
messages={messages}
|
||||
last={i === messages.length - 1}
|
||||
error={message.error ? true : false}
|
||||
scrollToBottom={i === messages.length - 1 ? scrollToBottom : null}
|
||||
edit={i===currentEditIdx}
|
||||
currentEditIdx={currentEditIdx}
|
||||
enterEdit={(cancel) => setCurrentEditIdx(cancel?-1:i)}
|
||||
/>
|
||||
))}
|
||||
<CSSTransition
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue