From 8ca7356489c0cdc522558075c8fd6873c43818e8 Mon Sep 17 00:00:00 2001 From: Martynas Bagdonas Date: Thu, 18 Aug 2022 10:09:09 +0300 Subject: [PATCH] Fix regression for broken "Snow in Page" Fixes #2764 Regression from 7ec54fd --- chrome/content/zotero/xpcom/reader.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/reader.js b/chrome/content/zotero/xpcom/reader.js index d3aae23131..546ad7e4d7 100644 --- a/chrome/content/zotero/xpcom/reader.js +++ b/chrome/content/zotero/xpcom/reader.js @@ -1376,7 +1376,9 @@ class Reader { this.triggerAnnotationsImportCheck(itemID); let reader; - if (!allowDuplicate) { + // If duplicating is not allowed, and no reader instance is loaded for itemID, + // try to find an unloaded tab and select it. Zotero.Reader.open will then be called again + if (!allowDuplicate && !this._readers.find(r => r._itemID === itemID)) { let win = Zotero.getMainWindow(); if (win) { let existingTabID = win.Zotero_Tabs.getTabIDByItemID(itemID);