From d03bdeef10c869a5247a1256fe3e05c9d7ddd913 Mon Sep 17 00:00:00 2001 From: you Date: Wed, 18 Mar 2026 22:38:12 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20stuck=20radar=20pings=20=E2=80=94=20add?= =?UTF-8?q?=202s=20safety=20timeout=20and=20try-catch=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/live.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/public/live.js b/public/live.js index a8733e11..3f4709fe 100644 --- a/public/live.js +++ b/public/live.js @@ -806,10 +806,18 @@ let r = 2, op = 0.9; const iv = setInterval(() => { r += 1.5; op -= 0.03; - if (op <= 0) { clearInterval(iv); animLayer.removeLayer(ring); return; } - ring.setRadius(r); - ring.setStyle({ opacity: op, weight: Math.max(0.3, 3 - r * 0.04) }); + if (op <= 0) { + clearInterval(iv); + try { animLayer.removeLayer(ring); } catch {} + return; + } + try { + ring.setRadius(r); + ring.setStyle({ opacity: op, weight: Math.max(0.3, 3 - r * 0.04) }); + } catch { clearInterval(iv); } }, 26); + // Safety cleanup — never let a ring live longer than 2s + setTimeout(() => { clearInterval(iv); try { animLayer.removeLayer(ring); } catch {} }, 2000); const baseColor = marker._baseColor || '#6b7280'; const baseSize = marker._baseSize || 6;