refresh library tab's icon cache on update (#4387)
When tabs' state is updated, refresh library tab's icon. Do not skip it if the icon already exists (as for reader tabs). Otherwise, when selected row from collectionTree changes, the icons in the library tab will not update. Fixes: #4385
This commit is contained in:
parent
b16bbc4a8a
commit
ac1cb29c69
1 changed files with 1 additions and 6 deletions
|
@ -96,9 +96,6 @@ var Zotero_Tabs = new function () {
|
|||
this._update = function () {
|
||||
// Go through all tabs and try to save their icons to tab.data
|
||||
for (let tab of this._tabs) {
|
||||
// If the icon was earlier cached, skip this tab
|
||||
if (tab.data.icon) continue;
|
||||
|
||||
// Find the icon for the library tab
|
||||
if (tab.id === 'zotero-pane') {
|
||||
let index = ZoteroPane.collectionsView?.selection?.focused;
|
||||
|
@ -107,7 +104,7 @@ var Zotero_Tabs = new function () {
|
|||
tab.data.icon = iconName;
|
||||
}
|
||||
}
|
||||
else {
|
||||
else if (!tab.data.icon) {
|
||||
// Try to fetch the icon for the reader tab
|
||||
try {
|
||||
let item = Zotero.Items.get(tab.data.itemID);
|
||||
|
@ -115,8 +112,6 @@ var Zotero_Tabs = new function () {
|
|||
}
|
||||
catch (e) {
|
||||
// item might not yet be loaded, we will get the right icon on the next update
|
||||
// but until then use a default placeholder
|
||||
tab.data.icon = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue