From f6b47987e9c876fa840792e3a26b2e6ec9e0c3d5 Mon Sep 17 00:00:00 2001 From: abaevbog Date: Wed, 26 Jun 2024 22:19:25 -0700 Subject: [PATCH] fix tab duplication breakage (#4286) Fix to breakage after 3f45def that would not open a duplicate tab but instead create another reader instance in the same tab. Instead of finding a tab for a specific item, use tabID that is passed when reader should be loaded in an unloaded tab. That allows us to know if the tab is being duplicated or not. Fixes: #4272 --- chrome/content/zotero/xpcom/reader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/reader.js b/chrome/content/zotero/xpcom/reader.js index 2581396ffb..a60f540e8b 100644 --- a/chrome/content/zotero/xpcom/reader.js +++ b/chrome/content/zotero/xpcom/reader.js @@ -1016,7 +1016,7 @@ class ReaderTab extends ReaderInstance { this._onToggleSidebarCallback = options.onToggleSidebar; this._onChangeSidebarWidthCallback = options.onChangeSidebarWidth; this._window = Services.wm.getMostRecentWindow('navigator:browser'); - let existingTabID = this._window.Zotero_Tabs.getTabIDByItemID(this._item.id); + let existingTabID = options.tabID; // If an unloaded tab for this item already exists, load the reader in it. // Otherwise, create a new tab if (existingTabID) {