Don't update item type menus within transaction when updating schema
This caused an error reported here, though I can't reproduce it: https://forums.zotero.org/discussion/80287/zotero-database-upgrade-error
This commit is contained in:
parent
858de5e6f2
commit
222870d3c7
1 changed files with 9 additions and 8 deletions
|
@ -775,14 +775,15 @@ Zotero.Schema = new function(){
|
|||
yield Zotero.SearchConditions.init();
|
||||
|
||||
// Update item type menus in every open window
|
||||
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
|
||||
.getService(Components.interfaces.nsIWindowMediator);
|
||||
var enumerator = wm.getEnumerator("navigator:browser");
|
||||
while (enumerator.hasMoreElements()) {
|
||||
var win = enumerator.getNext();
|
||||
win.ZoteroPane.buildItemTypeSubMenu();
|
||||
win.document.getElementById('zotero-editpane-item-box').buildItemTypeMenu();
|
||||
}
|
||||
Zotero.Schema.schemaUpdatePromise.then(function () {
|
||||
var wm = Services.wm;
|
||||
var enumerator = wm.getEnumerator("navigator:browser");
|
||||
while (enumerator.hasMoreElements()) {
|
||||
let win = enumerator.getNext();
|
||||
win.ZoteroPane.buildItemTypeSubMenu();
|
||||
win.document.getElementById('zotero-editpane-item-box').buildItemTypeMenu();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue