forked from React-Group/interstellar_ai
lol
This commit is contained in:
parent
82fe1285bf
commit
9373fa8e59
1 changed files with 2 additions and 2 deletions
|
@ -6,7 +6,7 @@ type ChatMessage = {
|
||||||
|
|
||||||
let chatHistory: ChatMessage[] = [];
|
let chatHistory: ChatMessage[] = [];
|
||||||
|
|
||||||
function addMessageHistory(name: string, message: any): void {
|
function addMessageToHistory(name: string, message: any): void {
|
||||||
const newMessage: ChatMessage = {
|
const newMessage: ChatMessage = {
|
||||||
name: name,
|
name: name,
|
||||||
messages: message,
|
messages: message,
|
||||||
|
@ -16,7 +16,7 @@ function addMessageHistory(name: string, message: any): void {
|
||||||
console.log(`Added message from ${name}: ${message}`);
|
console.log(`Added message from ${name}: ${message}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeMessageHistory(timestamp: number): void {
|
function removeMessageFromHistory(timestamp: number): void {
|
||||||
const index = chatHistory.findIndex((msg) => msg.timestamp === timestamp);
|
const index = chatHistory.findIndex((msg) => msg.timestamp === timestamp);
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
chatHistory.splice(index, 1);
|
chatHistory.splice(index, 1);
|
||||||
|
|
Loading…
Reference in a new issue