From 926cf5caaf6d8ca4e4ff2405a988b7f97ee2ee21 Mon Sep 17 00:00:00 2001 From: Ian Renton Date: Tue, 23 Dec 2025 21:58:25 +0000 Subject: [PATCH] Fix handling new spots by SSE when there weren't any others #3 --- webassets/js/spots.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webassets/js/spots.js b/webassets/js/spots.js index 13d443e..368917b 100644 --- a/webassets/js/spots.js +++ b/webassets/js/spots.js @@ -51,7 +51,9 @@ function restartSSEConnection() { } // If we had zero spots before (i.e. one now), the table will have a "No spots" row that we need to remove now // that we have one. - $("#table tbody tr").last().remove(); + if (spots.length == 1) { + $("#table tbody tr").last().remove(); + } // Add the new spot to table addSpotToTopOfTable(newSpot, true);