From f1098801e24feb4ad16ed0d22877c27a51c32c6c Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Mon, 15 Jul 2019 21:35:39 +0200 Subject: [PATCH] let's try to avoid browser problems --- htdocs/openwebrx.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/openwebrx.js b/htdocs/openwebrx.js index 4d184bf..b199eec 100644 --- a/htdocs/openwebrx.js +++ b/htdocs/openwebrx.js @@ -1418,11 +1418,11 @@ var wsjt_removal_interval; function init_wsjt_removal_timer() { if (wsjt_removal_interval) clearInterval(wsjt_removal_interval); setInterval(function(){ - // let's keep 2 hours that should be plenty for most users - var cutoff = new Date().getTime()- 2 * 60 * 60 * 1000; - $('#openwebrx-panel-wsjt-message tbody tr').filter(function(_, e){ - return $(e).data('timestamp') < cutoff; - }).remove(); + var $elements = $('#openwebrx-panel-wsjt-message tbody tr'); + // limit to 1000 entries in the list since browsers get laggy at some point + var toRemove = $elements.length - 1000; + if (toRemove <= 0) return; + $elements.slice(0, toRemove).remove(); }, 15000); }