diff --git a/app/components/ConversationFrontend.tsx b/app/components/ConversationFrontend.tsx index 80d77b3..34ffbc7 100644 --- a/app/components/ConversationFrontend.tsx +++ b/app/components/ConversationFrontend.tsx @@ -22,7 +22,7 @@ const ConversationFrontend = React.forwardRef ({ messages, onStopClick, onResendClick, onEditClick, onCopyClick, isClicked }, ref: ForwardedRef) => { const [isScrolling, setIsScrolling] = useState(true); const messagesEndRef = useRef(null); - const [chatHistory] = useChatHistory() + const [chatHistory, setChatHistory, setSelectedIndex] = useChatHistory() useEffect(() => { const observer = new IntersectionObserver( diff --git a/app/components/History.tsx b/app/components/History.tsx index 92b86e8..d109f24 100644 --- a/app/components/History.tsx +++ b/app/components/History.tsx @@ -8,10 +8,6 @@ const History: React.FC = () => { const handleEditButtonClick = () => { setIsEditing(true); - - /* Thank you Eslint for this masterpiece of a code snippet */ - setChatHistory(chatHistory) - /* Wow i feel so secure now */ }; const handleInputChange = (e: React.ChangeEvent) => { diff --git a/app/components/settings/settingUtils.ts b/app/components/settings/settingUtils.ts index de08012..a3b3e61 100644 --- a/app/components/settings/settingUtils.ts +++ b/app/components/settings/settingUtils.ts @@ -40,10 +40,10 @@ export function importSettings(jsonData: string): void { } export const sendToDatabase = async () => { - const useName = localStorage.getItem("accountName") - const usePassword = localStorage.getItem("accountPassword") + let useName = localStorage.getItem("accountName") + let usePassword = localStorage.getItem("accountPassword") if (useName && usePassword) { - const result = await changeSettings(useName, usePassword, JSON.parse(exportSettings())) + let result = await changeSettings(useName, usePassword, JSON.parse(exportSettings())) if (result == true) { alert('Data has been transferred') window.location.reload();