Fix version check logic (Pt. 2)

This commit is contained in:
Alex Liebowitz 2016-06-30 01:27:31 -04:00
parent b38b069034
commit ab15d96efe
2 changed files with 13 additions and 1 deletions

BIN
dist.zip

Binary file not shown.

View file

@ -142,7 +142,19 @@ lbry.checkNewVersionAvailable = function(callback) {
var remoteMaj, remoteMin, remotePatch; var remoteMaj, remoteMin, remotePatch;
[remoteMaj, remoteMin, remotePatch] = versionInfo.remote_lbrynet.split('.'); [remoteMaj, remoteMin, remotePatch] = versionInfo.remote_lbrynet.split('.');
var newVersionAvailable = !(maj >= remoteMaj && min >= remoteMin && patch >= remotePatch); if (maj < remoteMaj) {
var newVersionAvailable = true;
} else if (maj == remoteMaj) {
if (min < remoteMin) {
var newVersionAvailable = true;
} else if (min == remoteMin) {
var newVersionAvailable = (patch < remotePatch);
} else {
var newVersionAvailable = false;
}
} else {
var newVersionAvailable = false;
}
callback(newVersionAvailable); callback(newVersionAvailable);
}, function(err) { }, function(err) {
if (err.fault == 'NoSuchFunction') { if (err.fault == 'NoSuchFunction') {