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 - }}); - } }); };