Fix filtering to use both client type and instanceId for unique identification
All checks were successful
All checks were successful
This commit is contained in:
@@ -386,9 +386,11 @@ function renderDownloads() {
|
|||||||
// Filter downloads by selected clients
|
// Filter downloads by selected clients
|
||||||
let filteredDownloads = downloads;
|
let filteredDownloads = downloads;
|
||||||
if (selectedDownloadClients.length > 0) {
|
if (selectedDownloadClients.length > 0) {
|
||||||
// Map indices to instanceIds
|
// Map indices to client objects, then filter by both client type and instanceId
|
||||||
const selectedInstanceIds = selectedDownloadClients.map(idx => downloadClients[idx]?.id).filter(Boolean);
|
const selectedClients = selectedDownloadClients.map(idx => downloadClients[idx]).filter(Boolean);
|
||||||
filteredDownloads = downloads.filter(d => selectedInstanceIds.includes(d.instanceId));
|
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)
|
// Sort downloads by client order (matching the order in downloadClients)
|
||||||
|
|||||||
Reference in New Issue
Block a user