diff --git a/app/backend/InputOutputHandler.tsx b/app/backend/InputOutputHandler.tsx index 3bf20f0..bcdd034 100644 --- a/app/backend/InputOutputHandler.tsx +++ b/app/backend/InputOutputHandler.tsx @@ -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) diff --git a/app/components/History.tsx b/app/components/History.tsx index b0b23aa..ad8e9af 100644 --- a/app/components/History.tsx +++ b/app/components/History.tsx @@ -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; diff --git a/app/components/settings/Settings.tsx b/app/components/settings/Settings.tsx index 87b05b6..83612d0 100644 --- a/app/components/settings/Settings.tsx +++ b/app/components/settings/Settings.tsx @@ -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'; diff --git a/deployment_scripts/windows/scripts/run_py.bat b/deployment_scripts/windows/scripts/run_py.bat index d54c44e..c0a9e93 100644 --- a/deployment_scripts/windows/scripts/run_py.bat +++ b/deployment_scripts/windows/scripts/run_py.bat @@ -6,4 +6,4 @@ cd .. cd .. cd py -python api.py \ No newline at end of file +py api.py \ No newline at end of file