Don't select items in trash on target selector change

Items in the trash will still be updated properly (since they can still
exist in collections and have tags), but the collection selected in the
target selector should remain selected in the client.

Addresses zotero/zotero-connectors#220
This commit is contained in:
Dan Stillman 2018-03-29 07:24:05 -04:00
parent 00d85fb6da
commit a4aabd9f3e

View file

@ -151,7 +151,10 @@ Zotero.Server.Connector.SaveSession.prototype.update = async function (libraryID
if (this._objects.item.size == 1) {
let item = Array.from(this._objects.item)[0];
item = item.isTopLevelItem() ? item : item.parentItem;
await win.selectItem(item.id);
// Don't select if in trash
if (!item.deleted) {
await win.selectItem(item.id);
}
}
}
}