From 544c168b8245802c3704d25d6a9e3ac733f83c2e Mon Sep 17 00:00:00 2001 From: Gronod Date: Tue, 19 May 2026 23:51:57 +0100 Subject: [PATCH] Fix duplicate checkbox ID issue causing cross-selection between clients --- public/app.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/app.js b/public/app.js index 00a4e39..fbddca6 100644 --- a/public/app.js +++ b/public/app.js @@ -1140,16 +1140,17 @@ function updateDownloadClientFilter() { } // Add checkboxes for each download client - downloadClients.forEach(client => { + downloadClients.forEach((client, index) => { const option = document.createElement('div'); option.className = 'download-client-option'; + const checkboxId = `download-client-checkbox-${index}`; const checkbox = document.createElement('input'); checkbox.type = 'checkbox'; checkbox.className = 'download-client-checkbox'; checkbox.value = client.id; checkbox.checked = selectedDownloadClients.includes(client.id); - checkbox.id = `client-${client.id}`; + checkbox.id = checkboxId; // Toggle selection when checkbox changes checkbox.addEventListener('change', (e) => { @@ -1158,7 +1159,7 @@ function updateDownloadClientFilter() { const label = document.createElement('label'); label.className = 'download-client-option-label'; - label.htmlFor = `client-${client.id}`; + label.htmlFor = checkboxId; label.textContent = client.name; const typeBadge = document.createElement('span');