citation dialog: deduplicate open items (#5105)

So that if there are multiple tabs opened for the
same top level item, it appears only once in search
results.
This commit is contained in:
abaevbog 2025-03-13 20:35:09 -07:00 • committed by GitHub
parent 92d6e69b6e
commit ebdeab4b3e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -248,7 +248,9 @@ export class CitationDialogSearchHandler {
}
return Zotero.Cite.getItem(itemID);
});
return items;
// Return deduplicated items since there may be multiple tabs opened for the same
// top-level item (duplicate tabs or a multiple attachments belonging to the same item)
return [...new Set(items)];
}
_getSelectedLibraryItems() {