From 391b2085b392fcb931bd20647cd704e9bfc48959 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 12 Aug 2013 02:49:26 -0400 Subject: [PATCH] Tie bundled files update to initialization rather than timeout --- chrome/content/zotero/xpcom/schema.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/chrome/content/zotero/xpcom/schema.js b/chrome/content/zotero/xpcom/schema.js index dcce1f67ee..791da1a3af 100644 --- a/chrome/content/zotero/xpcom/schema.js +++ b/chrome/content/zotero/xpcom/schema.js @@ -138,14 +138,16 @@ Zotero.Schema = new function(){ } // After a delay, start update of bundled files and repo updates - setTimeout(function () { + Zotero.initializationPromise + .delay(5000) + .then(function () { Zotero.UnresponsiveScriptIndicator.disable(); - Zotero.Schema.updateBundledFiles(null, false, true) + return Zotero.Schema.updateBundledFiles(null, false, true) .finally(function () { - Zotero.UnresponsiveScriptIndicator.enable(); - }) - .done(); - }, 5000); + Zotero.UnresponsiveScriptIndicator.enable(); + }); + }) + .done(); return updated; });