do not try to select deleted item in a collection (#5061)

After navigating to the collection from "Libraries and Collections"
section of an item in the trash. Deleted item does not appear in actual
collections and trying to select it will just re-select the trash.

Fixes: #5060
This commit is contained in:
abaevbog 2025-02-25 02:24:59 -08:00 • committed by GitHub
parent a3ebb4ad41
commit c049120efb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -157,7 +157,12 @@ import { getCSSIcon } from 'components/icons';
if (!disableClicky) {
box.addEventListener('click', async () => {
await ZoteroPane.collectionsView.selectByID(obj.treeViewID);
await ZoteroPane.selectItem(contextItem.id);
// Do not try to view deleted items in a collection.
// They do not appear outside of trash, and selecting a deleted item
// will re-open trash in collectionTree.
if (!contextItem.deleted) {
await ZoteroPane.selectItem(contextItem.id);
}
});
}