Fix double-toggling issue in download client filter
All checks were successful
Build and Push Docker Image / build (push) Successful in 1m15s
Licence Check / Licence compatibility and copyright header verification (push) Successful in 1m0s
CI / Security audit (push) Successful in 1m26s
CI / Tests & coverage (push) Successful in 1m38s

This commit is contained in:
2026-05-19 23:48:29 +01:00
parent 49d66c07ee
commit 747a14ebd3

View File

@@ -1151,6 +1151,11 @@ function updateDownloadClientFilter() {
checkbox.checked = selectedDownloadClients.includes(client.id);
checkbox.id = `client-${client.id}`;
// Toggle selection when checkbox changes
checkbox.addEventListener('change', (e) => {
toggleClientSelection(client.id, e.target.checked);
});
const label = document.createElement('label');
label.className = 'download-client-option-label';
label.htmlFor = `client-${client.id}`;
@@ -1164,19 +1169,6 @@ function updateDownloadClientFilter() {
option.appendChild(label);
option.appendChild(typeBadge);
// Toggle selection when clicking the row
option.addEventListener('click', (e) => {
if (e.target !== checkbox) {
checkbox.checked = !checkbox.checked;
}
toggleClientSelection(client.id, checkbox.checked);
});
// Toggle selection when checkbox changes
checkbox.addEventListener('change', (e) => {
toggleClientSelection(client.id, e.target.checked);
});
optionsContainer.appendChild(option);
});