Eine Seite kommt nur einmal in der Liste vor

pull/80/head
Zainab2604 2025-06-22 12:44:30 +02:00
parent 60b303d92e
commit 61dcc76203
1 changed files with 4 additions and 1 deletions

View File

@ -75,7 +75,10 @@ function ExtractedResultsPage() {
if (!map.has(key)) { if (!map.has(key)) {
map.set(key, { ...item, pages: [item.page] }); map.set(key, { ...item, pages: [item.page] });
} else { } else {
map.get(key)!.pages.push(item.page); const existingEntry = map.get(key)!;
if (!existingEntry.pages.includes(item.page)) {
existingEntry.pages.push(item.page);
}
} }
}); });
return Array.from(map.values()); return Array.from(map.values());