fix
This commit is contained in:
parent
192070333c
commit
4d2e5332d8
@ -43,7 +43,7 @@ async function saveMessage(chatId, message) {
|
||||
localStorage.setItem(`chatHistory-${chatId}`, JSON.stringify(chatHistory));
|
||||
|
||||
// Aktualisiere den Button-Text in der Sidebar
|
||||
updateChatSessionButton(chatId, message);
|
||||
updateChatSessionButton(chatId);
|
||||
|
||||
// Sende die Nachricht an den Chatbot
|
||||
const userMessage = getLastUserMessage();
|
||||
@ -56,7 +56,7 @@ async function saveMessage(chatId, message) {
|
||||
}
|
||||
}
|
||||
|
||||
function updateChatSessionButton(chatId, message) {
|
||||
function updateChatSessionButton(chatId) {
|
||||
const button = document.getElementById(`chatSession-${chatId}`);
|
||||
if (button) {
|
||||
const chatHistory = JSON.parse(localStorage.getItem(`chatHistory-${chatId}`)) || [];
|
||||
@ -138,6 +138,10 @@ function loadAllChatSessions() {
|
||||
}
|
||||
});
|
||||
console.log(chatCount)
|
||||
|
||||
for (let i = 0; i < chatCount; i++) {// Aktualisiere die Namen an der Seite
|
||||
updateChatSessionButton(i);
|
||||
}
|
||||
// Lade den neuesten Chat-Verlauf
|
||||
if (chatCount > 0) {
|
||||
loadChatHistory(chatCount - 1);
|
||||
@ -294,6 +298,3 @@ async function stream_api_open_ai(userMessage) {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
//TODO: Die Chatbot-Nachrichten müssen noch in den Cache geladen werden!!!
|
Loading…
Reference in New Issue
Block a user