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
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user