Fix filtering to use both client type and instanceId for unique identification
All checks were successful
Build and Push Docker Image / build (push) Successful in 59s
Licence Check / Licence compatibility and copyright header verification (push) Successful in 1m2s
CI / Security audit (push) Successful in 1m29s
CI / Tests & coverage (push) Successful in 1m32s

This commit is contained in:
2026-05-20 00:00:17 +01:00
parent 1ab7e52167
commit 80cf3eaa39

View File

@@ -386,9 +386,11 @@ function renderDownloads() {
// Filter downloads by selected clients
let filteredDownloads = downloads;
if (selectedDownloadClients.length > 0) {
// Map indices to instanceIds
const selectedInstanceIds = selectedDownloadClients.map(idx => downloadClients[idx]?.id).filter(Boolean);
filteredDownloads = downloads.filter(d => selectedInstanceIds.includes(d.instanceId));
// Map indices to client objects, then filter by both client type and instanceId
const selectedClients = selectedDownloadClients.map(idx => downloadClients[idx]).filter(Boolean);
filteredDownloads = downloads.filter(d =>
selectedClients.some(c => c.type === d.client && c.id === d.instanceId)
);
}
// Sort downloads by client order (matching the order in downloadClients)