Fix feed update refreshing, scrolling item and collection trees

Closes #2950
This commit is contained in:
Adomas Venčkauskas 2023-04-14 15:21:52 +03:00
parent 49b7e43c81
commit fd744fb526
2 changed files with 12 additions and 2 deletions

View file

@ -640,7 +640,10 @@ var CollectionTree = class CollectionTree extends LibraryTree {
return;
}
if (type == 'feed' && (action == 'unreadCountUpdated' || action == 'statusChanged')) {
this.tree.invalidate();
let feedRow = this.getRowIndexByID("L" + ids[0]);
if (feedRow !== false) {
this.tree.invalidateRow(feedRow);
}
return;
}
@ -745,7 +748,7 @@ var CollectionTree = class CollectionTree extends LibraryTree {
// Invalidate parent in case it's become non-empty
let parentRow = this.getRowIndexByID("C" + collection.parentID);
if (parentRow !== false) {
this._treebox.invalidateRow(parentRow);
this.tree.invalidateRow(parentRow);
}
}
break;
@ -769,6 +772,9 @@ var CollectionTree = class CollectionTree extends LibraryTree {
}
}
break;
case 'feed':
break;
default:
await this.reload();

View file

@ -94,6 +94,10 @@ function doUnload()
var onCollectionSelected = async function () {
if (!collectionsView.selection.count) return;
// Collection not changed
if (itemsView && itemsView.collectionTreeRow && itemsView.collectionTreeRow.id == collectionTreeRow.id) {
return;
}
var collectionTreeRow = collectionsView.getRow(collectionsView.selection.focused);
collectionTreeRow.setSearch('');
Zotero.Prefs.set('lastViewedFolder', collectionTreeRow.id);