forked from React-Group/interstellar_ai
Compare commits
7 commits
1c82fc87d6
...
35151b2c53
Author | SHA1 | Date | |
---|---|---|---|
35151b2c53 | |||
f9bce3b22a | |||
60f9a7d058 | |||
28ebe02bd6 | |||
|
088aa0170c | ||
2790604f6b | |||
e9f91f3f73 |
4 changed files with 10 additions and 12 deletions
|
@ -317,20 +317,20 @@ const InputOutputBackend: React.FC = () => {
|
|||
}
|
||||
|
||||
const handleResendClick = () => {
|
||||
const temporary_message = messages[messages.length - 2]['content']
|
||||
const updatedMessages = messages.slice(0, -2)
|
||||
setMessages(updatedMessages)
|
||||
const msg = chatHistory.chats[chatHistory.selectedIndex].messages
|
||||
const lastUserMessage = msg[msg.length-2].content
|
||||
msg.splice(msg.length-2,2)
|
||||
endGetWorker()
|
||||
getNewToken()
|
||||
setInputDisabled(false)
|
||||
handleSendClick(temporary_message, true)
|
||||
handleSendClick(lastUserMessage, true)
|
||||
}
|
||||
|
||||
const handleEditClick = () => {
|
||||
const newestMessage = messages[messages.length - 2].content
|
||||
setInputMessage(newestMessage)
|
||||
const updatedMessages = messages.slice(0, messages.length - 2)
|
||||
setMessages(updatedMessages)
|
||||
const msg = chatHistory.chats[chatHistory.selectedIndex].messages
|
||||
const lastUserMessage = msg[msg.length-2].content
|
||||
setInputMessage(lastUserMessage)
|
||||
msg.splice(msg.length-2,2)
|
||||
endGetWorker()
|
||||
getNewToken()
|
||||
setInputDisabled(false)
|
||||
|
|
|
@ -46,7 +46,7 @@ const History: React.FC = () => {
|
|||
copyChats.chats = [...chatHistory.chats]
|
||||
|
||||
// Remove the chat at the specified index
|
||||
copyChats.chats.splice(index,1)
|
||||
copyChats.chats.splice(index,1)
|
||||
|
||||
// Determine new selectedIndex
|
||||
let newSelectedIndex = currentIndex;
|
||||
|
|
|
@ -12,11 +12,9 @@ import PrivacySettings from './PrivacySettings';
|
|||
import FontSizeSetting from './FontSize';
|
||||
import OpenSourceModeToggle from './OpenSourceToggle';
|
||||
import {
|
||||
changeHistory,
|
||||
changeSettings,
|
||||
createAccount,
|
||||
deleteAccount,
|
||||
getHistory,
|
||||
} from '../../backend/database';
|
||||
import ThemeDropdown from './DropDownTheme';
|
||||
|
||||
|
|
|
@ -6,4 +6,4 @@ cd ..
|
|||
cd ..
|
||||
|
||||
cd py
|
||||
python api.py
|
||||
py api.py
|
Loading…
Reference in a new issue