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
parent a396771cbc
commit e1997620a4

View file

@ -128,12 +128,23 @@ var Zotero_Tabs = new function () {
} }
else if (tab.type === 'reader') { else if (tab.type === 'reader') {
if (Zotero.Items.exists(tab.data.itemID)) { if (Zotero.Items.exists(tab.data.itemID)) {
this.add({ if (tab.selected) {
type: 'reader-unloaded', Zotero.Reader.open(tab.data.itemID,
title: tab.title, null,
index: i, {
data: tab.data title: tab.title,
}); openInBackground: !tab.selected
}
);
}
else {
this.add({
type: 'reader-unloaded',
title: tab.title,
index: i,
data: tab.data
});
}
} }
} }
} }