diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index e74273afb..1f38ea1a8 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -848,6 +848,8 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js"); Zotero.Feeds.init(); Zotero.addShutdownListener(() => Zotero.Feeds.uninit()); + Zotero.Schema.schemaUpdatePromise.then(Zotero.purgeDataObjects.bind(Zotero)); + return true; } catch (e) { @@ -1987,6 +1989,8 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js"); * Clear entries that no longer exist from various tables */ this.purgeDataObjects = Zotero.Promise.coroutine(function* () { + var d = new Date(); + yield Zotero.DB.executeTransaction(function* () { return Zotero.Creators.purge(); }); @@ -2001,6 +2005,8 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js"); //yield Zotero.DB.executeTransaction(function* () { // return Zotero.Relations.purge(); //}); + + Zotero.debug("Purged data tables in " + (new Date() - d) + " ms"); }); diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index 48d0a26f4..30638e193 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -414,11 +414,6 @@ var ZoteroPane = new function() searchBar.inputField.select(); }, 1); - var d = new Date(); - yield Zotero.purgeDataObjects(); - var d2 = new Date(); - Zotero.debug("Purged data tables in " + (d2 - d) + " ms"); - // Auto-sync on pane open or if new account if (Zotero.Prefs.get('sync.autoSync') || Zotero.initAutoSync) { yield Zotero.proxyAuthComplete;