Merge pull request 'main' (#136) from YasinOnm08/interstellar_ai:main into main

Reviewed-on: https://interstellardevelopment.org/code/code/React-Group/interstellar_ai/pulls/136
This commit is contained in:
Patrick 2024-10-11 08:45:52 +02:00
commit f9bce3b22a
2 changed files with 9 additions and 9 deletions

View file

@ -317,20 +317,20 @@ const InputOutputBackend: React.FC = () => {
} }
const handleResendClick = () => { const handleResendClick = () => {
const temporary_message = messages[messages.length - 2]['content'] const msg = chatHistory.chats[chatHistory.selectedIndex].messages
const updatedMessages = messages.slice(0, -2) const lastUserMessage = msg[msg.length-2].content
setMessages(updatedMessages) msg.splice(msg.length-2,2)
endGetWorker() endGetWorker()
getNewToken() getNewToken()
setInputDisabled(false) setInputDisabled(false)
handleSendClick(temporary_message, true) handleSendClick(lastUserMessage, true)
} }
const handleEditClick = () => { const handleEditClick = () => {
const newestMessage = messages[messages.length - 2].content const msg = chatHistory.chats[chatHistory.selectedIndex].messages
setInputMessage(newestMessage) const lastUserMessage = msg[msg.length-2].content
const updatedMessages = messages.slice(0, messages.length - 2) setInputMessage(lastUserMessage)
setMessages(updatedMessages) msg.splice(msg.length-2,2)
endGetWorker() endGetWorker()
getNewToken() getNewToken()
setInputDisabled(false) setInputDisabled(false)