Put a cap on how many new messages we store browser-side. Unbounded growth is leading to crashed tabs and unresponsiveness.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4638 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2023-11-18 15:58:16 +00:00
parent dff8eca16e
commit a6f1eaa09e
2 changed files with 2 additions and 1 deletions

View File

@ -1,5 +1,5 @@
{
"type": "tildefriends-app",
"emoji": "🐌",
"previous": "&dc3Eovh35uB024L4dyFX+n8N37ove9STsKmkKlO/pcQ=.sha256"
"previous": "&vIYnoUkbz97WRvyunV+ETe+Y6tJk7tTEVvgYuwkoDiM=.sha256"
}

View File

@ -156,6 +156,7 @@ class TfElement extends LitElement {
]);
if (messages && messages.length) {
this.unread = [...this.unread, ...messages];
this.unread = this.unread.slice(this.unread.length - 1024);
}
}