Browse Source

remove old chat messages

main
Hendrik Langer 4 years ago
parent
commit
dcfd0265fa
  1. 3
      raspberry/roberto/views/frontend/templates/index.html

3
raspberry/roberto/views/frontend/templates/index.html

@ -200,6 +200,9 @@ socket.on('text', (data) => {
var new_message = document.createElement('p'); var new_message = document.createElement('p');
new_message.innerHTML = data.data; new_message.innerHTML = data.data;
chatlog.append(new_message); chatlog.append(new_message);
if (chatlog.children.length > 10) {
chatlog.children[0].remove();
}
}); });
function displayText(text, left, top) { function displayText(text, left, top) {

Loading…
Cancel
Save