From ac1cb29c6947c5d01de6acaf8c332ea5751d19f8 Mon Sep 17 00:00:00 2001 From: abaevbog Date: Sat, 13 Jul 2024 12:46:33 -0700 Subject: [PATCH] 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 --- chrome/content/zotero/tabs.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/chrome/content/zotero/tabs.js b/chrome/content/zotero/tabs.js index c127dd9e3f..fc9c905a03 100644 --- a/chrome/content/zotero/tabs.js +++ b/chrome/content/zotero/tabs.js @@ -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; } } }