mirror of
https://github.com/zotero/zotero.git
synced 2026-09-11 22:51:15 +00:00
fix(notes): prevent unloaded note tabs from opening as windows on shutdown
Fix an issue where closing Zotero incorrectly opens notes as window if `note-unloaded` tabs exist after the currently selected tab. Previously, if Note A was opened as a tab and focus switched to a preceding tab, restarting Zotero would load Note A as `note-unloaded`. Upon closing Zotero again, Note A would incorrectly spawn as a separate window instead of closing with the main pane. This fix ensures that `note-unloaded` type note tabs are not incorrectly opened in new window during the shutdown process.
This commit is contained in:
parent
391e8497a6
commit
9c1af8e61c
1 changed files with 6 additions and 0 deletions
|
|
@ -781,6 +781,12 @@ var Zotero_Tabs = new function () {
|
|||
* Close all tabs except the first one
|
||||
*/
|
||||
this.closeAll = function () {
|
||||
// Ensure a non-loadable tab is selected before bulk-close. Otherwise,
|
||||
// closing the currently selected tab can auto-select an unloaded tab,
|
||||
// which triggers lazy-load hooks during shutdown.
|
||||
if (this._selectedID !== 'zotero-pane') {
|
||||
this.select('zotero-pane');
|
||||
}
|
||||
this.close(this._tabs.slice(1).map(x => x.id));
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue