fix for client version upgrade

This commit is contained in:
Nuwan 2023-07-20 04:11:44 +05:30
parent e03389909e
commit 81b3fecfd4
2 changed files with 16 additions and 15 deletions

View File

@ -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");

View File

@ -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();