Fix regression that prevents showing the last selected tab on startup

Fixes #2723
This commit is contained in:
Martynas Bagdonas 2022-07-25 11:51:05 +03:00 committed by Dan Stillman
parent b02ad0dc83
commit 44ef4cd35a

View file

@ -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
});
}
}
}
}