From a6f1eaa09e0abf79c427adc0df1f8ea8d2c925f5 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sat, 18 Nov 2023 15:58:16 +0000 Subject: [PATCH] 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 --- apps/ssb.json | 2 +- apps/ssb/tf-app.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/ssb.json b/apps/ssb.json index 71365afb..c8c4252f 100644 --- a/apps/ssb.json +++ b/apps/ssb.json @@ -1,5 +1,5 @@ { "type": "tildefriends-app", "emoji": "🐌", - "previous": "&dc3Eovh35uB024L4dyFX+n8N37ove9STsKmkKlO/pcQ=.sha256" + "previous": "&vIYnoUkbz97WRvyunV+ETe+Y6tJk7tTEVvgYuwkoDiM=.sha256" } \ No newline at end of file diff --git a/apps/ssb/tf-app.js b/apps/ssb/tf-app.js index efb6e6b8..d3ce812d 100644 --- a/apps/ssb/tf-app.js +++ b/apps/ssb/tf-app.js @@ -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); } }