Fix next duplicates set selection after merge (#2448)

This commit is contained in:
Abe Jellinek 2022-03-31 17:46:30 -07:00 committed by GitHub
parent 3356557493
commit a5b3d6440b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View file

@ -759,7 +759,10 @@ var ItemTree = class ItemTree extends LibraryTree {
}
// On removal of a selected row, select item at previous position
else if (savedSelection.length) {
if ((action == 'remove' || action == 'trash' || action == 'delete')
if ((action == 'remove'
|| action == 'trash'
|| action == 'delete'
|| action == 'removeDuplicatesMaster')
&& savedSelection.some(id => this.getRowIndexByID(id) === false)) {
// In duplicates view, select the next set on delete
if (collectionTreeRow.isDuplicates()) {

View file

@ -1013,13 +1013,14 @@ Zotero.Items = function() {
}
item.setField('dateAdded', earliestDateAdded);
// Hack to remove master item from duplicates view without recalculating duplicates
// Pass force = true so observers will be notified before this transaction is committed
yield Zotero.Notifier.trigger('removeDuplicatesMaster', 'item', item.id, null, true);
for (let i in toSave) {
yield toSave[i].save();
}
// Hack to remove master item from duplicates view without recalculating duplicates
Zotero.Notifier.trigger('removeDuplicatesMaster', 'item', item.id);
}.bind(this));
};