mcongrove / ChariTi

Please do not use: this is out-dated
Other
113 stars 85 forks source link

Compare logic for CVersion and minimumVersion seems to be wrong #233

Closed rollsroyc3 closed 10 years ago

rollsroyc3 commented 10 years ago

In update.js on line 80:

var current = parseInt(Ti.App.Properties.getString("CVERSION", APP.CVERSION).replace(".", ""), 10);
var minimum = parseInt(data.minimumVersion.replace(".", ""), 10);

If CVersion is 1.2.1 and minimumVersion is 1.2.2 you will get 12 for both values and the condition will prove true which is incorrect.

JSFiddle for demo: http://jsfiddle.net/aroyce/PkQ4M/2/

Rather than tweak the above I found a version compare function that seems to handle anything I throw at it. Let me know if you want me to submit a pull request.

mcongrove commented 10 years ago

Fixed by 5f405ffe9473c6abce5639da998c3bf2f49cb4f1.