This commit is contained in:
YasinOnm08 2024-10-04 15:31:46 +02:00
parent 0dce46994b
commit 69d53ed911
3 changed files with 4 additions and 8 deletions

View file

@ -14,6 +14,7 @@ function addMessageToHistory(name: string, message: any): void {
};
chatHistory.push(newMessage);
console.log(`Added message from ${name}: ${message}`);
chatHistory.sort((a,b) => b.timestamp - a.timestamp)
}
function removeMessageFromHistory(timestamp: number): void {