From 44ef4cd35a715782042b57c4a4ba834ac272790a Mon Sep 17 00:00:00 2001 From: Martynas Bagdonas Date: Mon, 25 Jul 2022 11:51:05 +0300 Subject: [PATCH] Fix regression that prevents showing the last selected tab on startup Fixes #2723 --- chrome/content/zotero/tabs.js | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/chrome/content/zotero/tabs.js b/chrome/content/zotero/tabs.js index 1c80a601e2..6f858c953f 100644 --- a/chrome/content/zotero/tabs.js +++ b/chrome/content/zotero/tabs.js @@ -128,12 +128,23 @@ var Zotero_Tabs = new function () { } else if (tab.type === 'reader') { if (Zotero.Items.exists(tab.data.itemID)) { - this.add({ - type: 'reader-unloaded', - title: tab.title, - index: i, - data: tab.data - }); + if (tab.selected) { + Zotero.Reader.open(tab.data.itemID, + null, + { + title: tab.title, + openInBackground: !tab.selected + } + ); + } + else { + this.add({ + type: 'reader-unloaded', + title: tab.title, + index: i, + data: tab.data + }); + } } } }