do not open hidden Zotero window on connector save

And fix regression where selecting a collection
in connector would always switch to the library tab.
It was originally added in https://github.com/zotero/zotero/pull/5020
but was lost after https://github.com/zotero/zotero/pull/5148.
This commit is contained in:
Bogdan Abaev 2025-06-11 12:53:05 -07:00 • committed by Adomas Ven
parent 1c469ce1a0
commit f50e8b0b35
2 changed files with 3 additions and 3 deletions

View file

@ -190,7 +190,7 @@ Zotero.Server.Connector.SaveSession = class {
item = item.isTopLevelItem() ? item : item.parentItem;
// Don't select if in trash
if (!item.deleted) {
await zp.selectItem(item.id);
await zp.selectItem(item.id, { noTabSwitch: true, noWindowRestore: true });
}
}
}

View file

@ -3023,7 +3023,7 @@ var ZoteroPane = new function()
Zotero.warn("ZoteroPane.selectItems() now takes an 'options' object -- update your code");
options = { inLibraryRoot: options };
}
let { inLibraryRoot, noTabSwitch } = options;
let { inLibraryRoot, noTabSwitch, noWindowRestore } = options;
if (!itemIDs.length) {
return false;
}
@ -3034,7 +3034,7 @@ var ZoteroPane = new function()
}
// Restore window if it's in the dock
if (window.windowState == window.STATE_MINIMIZED) {
if (window.windowState == window.STATE_MINIMIZED && !noWindowRestore) {
window.restore();
}