show selected chat

This commit is contained in:
YasinOnm08 2024-10-09 15:07:05 +02:00
parent 44b34ba9c6
commit 416dcb17ef
3 changed files with 4 additions and 21 deletions

View file

@ -1,19 +0,0 @@
/* import { Settings } from 'electron'
type Message = {
role: string
content: string
}
type Chat = {
name: string
messages: Message[]
}
type Data = {
chats: Chat[]
settings: Settings[]
} */

View file

@ -35,7 +35,10 @@ const History: React.FC = () => {
{/* Populate with history items */} {/* Populate with history items */}
{chatHistory.chats.map((chats, index) => ( {chatHistory.chats.map((chats, index) => (
<li key={index}> <li key={index}>
<a href="#" onClick={() => handleHistoryClick(index)}> <a href="#" onClick={() => handleHistoryClick(index)} style={{
backgroundColor: chatHistory.selectedIndex == index ? "var(--input-button-color)" : "",
borderRadius:"5px"
}}>
{chatHistory.chats[index].name} {chatHistory.chats[index].name}
</a> </a>
</li> </li>

View file

@ -45,7 +45,6 @@ export const sendToDatabase = async () => {
if (useName && usePassword) { if (useName && usePassword) {
const result = await changeSettings(useName, usePassword, JSON.parse(exportSettings())) const result = await changeSettings(useName, usePassword, JSON.parse(exportSettings()))
if (result == true) { if (result == true) {
alert('Data has been transferred')
window.location.reload(); window.location.reload();
} }
} }