diff --git a/web/app/assets/javascripts/clientUpdate.js b/web/app/assets/javascripts/clientUpdate.js index 8b4ea6f52..50c559751 100644 --- a/web/app/assets/javascripts/clientUpdate.js +++ b/web/app/assets/javascripts/clientUpdate.js @@ -201,7 +201,7 @@ } } - async function runCheck(product, version, uri, size, currentVersion) { + function runCheck(product, version, uri, size, currentVersion) { if (app.clientUpdating) { logger.debug("client is already updating; skipping") @@ -209,18 +209,18 @@ } if(currentVersion === undefined) { - currentVersion = await context.jamClient.ClientUpdateVersion(); - - if (!forceShow && (currentVersion == null || currentVersion.indexOf("Compiled")) > -1) { - // this is a developer build; it doesn't make much sense to do an packaged update, so skip - logger.debug("skipping client update check because this is a development build ('" + currentVersion + "')") - return; - } - - // # strange client oddity: remove quotes, if found, from start and finish of version. - if (currentVersion.indexOf('"') == 0 && currentVersion.lastIndexOf('"') == currentVersion.length - 1) { - currentVersion = currentVersion.substring(1, currentVersion.length - 1); - } + context.jamClient.ClientUpdateVersion().then(function(currentVersion){ + if (!forceShow && (currentVersion == null || currentVersion.indexOf("Compiled")) > -1) { + // this is a developer build; it doesn't make much sense to do an packaged update, so skip + logger.debug("skipping client update check because this is a development build ('" + currentVersion + "')") + return; + } + + // # strange client oddity: remove quotes, if found, from start and finish of version. + if (currentVersion.indexOf('"') == 0 && currentVersion.lastIndexOf('"') == currentVersion.length - 1) { + currentVersion = currentVersion.substring(1, currentVersion.length - 1); + } + }); } logger.debug("our client version: " + currentVersion + ", server client version: " + version); @@ -284,7 +284,9 @@ type: "GET", url: "/api/versioncheck?product=" + product + "&os=" + os, success: function (response) { - runCheck(product, response.version, response.uri, response.size, currentVersion); + if(JSON.stringify(response) !== "{}"){ + runCheck(product, response.version, response.uri, response.size, currentVersion); + } }, error: function (jqXHR, textStatus, errorThrown) { logger.error("Unable to do a client update check against /api/versioncheck"); diff --git a/web/app/assets/javascripts/everywhere/everywhere.js b/web/app/assets/javascripts/everywhere/everywhere.js index 1791751ef..68a19c991 100644 --- a/web/app/assets/javascripts/everywhere/everywhere.js +++ b/web/app/assets/javascripts/everywhere/everywhere.js @@ -37,7 +37,6 @@ if(!app) throw "app not found"; // makes window.jamClient / context.jamClient set to something non-null very early on - console.log("____DEBUG everywhere", context.jamClient) context.JK.initJamClient(app); updateScoringIntervals();