From df97dc27172b16cef3c5ab9feeed2edec6de6662 Mon Sep 17 00:00:00 2001 From: Emily Stark Date: Thu, 23 Oct 2014 14:33:07 -0700 Subject: [PATCH] Fix mistaken cordova `ClientVersions` insert/update inside `onListening` block. --- packages/autoupdate/autoupdate_server.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/autoupdate/autoupdate_server.js b/packages/autoupdate/autoupdate_server.js index 182b31e8ac..010412b1e4 100644 --- a/packages/autoupdate/autoupdate_server.js +++ b/packages/autoupdate/autoupdate_server.js @@ -108,6 +108,18 @@ var updateVersions = function (shouldReloadClientProgram) { }}); } + if (! ClientVersions.findOne({_id: "version-cordova"})) { + ClientVersions.insert({ + _id: "version-cordova", + version: Autoupdate.autoupdateVersionCordova, + refreshable: false + }); + } else { + ClientVersions.update("version-cordova", { $set: { + version: Autoupdate.autoupdateVersionCordova + }}); + } + // Use `onListening` here because we need to use // `WebAppInternals.refreshableAssets`, which is only set after // `WebApp.generateBoilerplate` is called by `main` in webapp. @@ -124,18 +136,6 @@ var updateVersions = function (shouldReloadClientProgram) { assets: WebAppInternals.refreshableAssets }}); } - - if (! ClientVersions.findOne({_id: "version-cordova"})) { - ClientVersions.insert({ - _id: "version-cordova", - version: Autoupdate.autoupdateVersionCordova, - refreshable: false - }); - } else { - ClientVersions.update("version-cordova", { $set: { - version: Autoupdate.autoupdateVersionCordova - }}); - } }); };