Fix message history by adding new clear function for internal command
This commit is contained in:
parent
458954c1e1
commit
59e72998c6
13
app.js
13
app.js
@ -739,7 +739,7 @@ async function updateIcon(username, avatarBuffer) {
|
||||
}
|
||||
}
|
||||
|
||||
function clearMessages() {
|
||||
function clearMessagesCMD() {
|
||||
const messagesContainer = document.querySelector('#messages');
|
||||
while (messagesContainer.firstChild) {
|
||||
messagesContainer.removeChild(messagesContainer.firstChild);
|
||||
@ -750,6 +750,17 @@ function clearMessages() {
|
||||
messagesStore[topic] = [];
|
||||
}
|
||||
|
||||
function clearMessages() {
|
||||
const messagesContainer = document.querySelector('#messages');
|
||||
while (messagesContainer.firstChild) {
|
||||
messagesContainer.removeChild(messagesContainer.firstChild);
|
||||
}
|
||||
|
||||
// Clear the messages from the store for the current room
|
||||
// const topic = currentTopic();
|
||||
// messagesStore[topic] = [];
|
||||
}
|
||||
|
||||
function toggleSetupView() {
|
||||
const setupDiv = document.querySelector('#setup');
|
||||
setupDiv.classList.toggle('hidden');
|
||||
|
@ -20,7 +20,7 @@ export default async function handleCommand(command, context) {
|
||||
|
||||
switch (cmd) {
|
||||
case '~clear':
|
||||
clearMessages();
|
||||
clearMessagesCMD();
|
||||
break;
|
||||
case '~ping':
|
||||
addMessage('LinkUp', 'pong', agentAvatar, currentTopic());
|
||||
|
Loading…
Reference in New Issue
Block a user