From 93af95d8652d77b1f2bb7148670c3935425d4ffc Mon Sep 17 00:00:00 2001 From: BoulderBadgeDad Date: Mon, 15 Jun 2026 21:37:42 -0700 Subject: [PATCH] #876: show the real Quarantine tab count on open (not a stale 0) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Quarantine tab badge was only populated by loadQuarantineList(), which runs when the tab is clicked — so opening Library History showed a stale 0 until then. Refresh the count on modal open via the existing /api/quarantine/list endpoint. --- webui/static/wishlist-tools.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/webui/static/wishlist-tools.js b/webui/static/wishlist-tools.js index b59ab783..8f95c421 100644 --- a/webui/static/wishlist-tools.js +++ b/webui/static/wishlist-tools.js @@ -3253,9 +3253,23 @@ function openLibraryHistoryModal() { overlay.classList.remove('hidden'); _libraryHistoryState.page = 1; loadLibraryHistory(); + _refreshQuarantineTabCount(); // #876: count correct on open, not only after clicking the tab } } +// #876: keep the Quarantine tab badge accurate the moment the modal opens. The +// full count was previously only set by loadQuarantineList() (i.e. after the tab +// was clicked), so it showed a stale 0 until then. +async function _refreshQuarantineTabCount() { + const el = document.getElementById('history-quarantine-count'); + if (!el) return; + try { + const resp = await fetch('/api/quarantine/list'); + const data = await resp.json(); + el.textContent = (data.entries || []).length; + } catch (e) { /* leave the existing value on error */ } +} + // ────────────────────────────────────────────────────────────────────── // Quarantine tab — rendered inside the Library History modal as a third // tab next to Downloads + Server Imports. Reuses the existing list +