From 6a5c0698205c15a50449460a1e948b82d1635e44 Mon Sep 17 00:00:00 2001 From: Patrick_Pluto Date: Wed, 2 Oct 2024 14:01:16 +0200 Subject: [PATCH] history changes --- app/backend/ChatHistory.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/backend/ChatHistory.ts b/app/backend/ChatHistory.ts index f050898..62c9a50 100644 --- a/app/backend/ChatHistory.ts +++ b/app/backend/ChatHistory.ts @@ -1,22 +1,22 @@ type ChatMessage = { name: string; - message: any; + messages: any; timestamp: number; }; let chatHistory: ChatMessage[] = []; -function addMessage(name: string, message: any): void { +function addMessageHistory(name: string, message: any): void { const newMessage: ChatMessage = { name: name, - message: message, + messages: message, timestamp: Date.now() }; chatHistory.push(newMessage); console.log(`Added message from ${name}: ${message}`); } -function removeMessage(timestamp: number): void { +function removeMessageHistory(timestamp: number): void { const index = chatHistory.findIndex((msg) => msg.timestamp === timestamp); if (index > -1) { chatHistory.splice(index, 1);