Skip to content

Commit

Permalink
Autoformat
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinverschoor committed Mar 27, 2024
1 parent 16459dd commit 7e05601
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions view/adminhtml/web/js/versioncheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,25 @@ require([
'jquery'
], function (jQuery) {

function compareversion(version1,version2){
var result=false;

if(typeof version1 !=='object'){ version1=version1.toString().split('.'); }
if(typeof version2 !=='object'){ version2=version2.toString().split('.'); }

for(var i=0;i<(Math.max(version1.length,version2.length));i++){

if(version1[i]==undefined){ version1[i]=0; }
if(version2[i]==undefined){ version2[i]=0; }

if(Number(version1[i])<Number(version2[i])){
result=true;
function compareVersion (version1, version2) {
var result = false

if (typeof version1 !== 'object') { version1 = version1.toString().split('.'); }
if (typeof version2 !== 'object') { version2 = version2.toString().split('.'); }

for (var i = 0;i < (Math.max(version1.length, version2.length));i++) {
if (version1[i] == undefined) { version1[i] = 0; }
if (version2[i] == undefined) { version2[i] = 0; }

if (Number(version1[i]) < Number(version2[i])) {
result = true;
break;
}
if(version1[i]!=version2[i]){
if (version1[i] != version2[i]) {
break;
}
}
return(result);
return (result);
}

jQuery('#paynl_version_check_button').click(function () {
Expand All @@ -42,8 +41,8 @@ require([
var newest_version = json.version.substring(1);
var current_version = jQuery('#current_version').text();

if (compareversion(current_version, newest_version)) {
result = 'There is a new version available (' + json.version + ')'
if (compareVersion(current_version, newest_version)) {
result = 'There is a new version available (' + json.version + ')';
} else {
jQuery('#paynl_version_check_button').hide();
result = jQuery('#VC_version_check_result_success').text();
Expand Down

0 comments on commit 7e05601

Please sign in to comment.