Improve updates check
This commit is contained in:
parent
36a8923e82
commit
5c042b5995
|
@ -9,12 +9,14 @@ angApp.controller('DefaultController', function($scope, $timeout, $http, AppInfo
|
||||||
url: $scope.appInfo.APP_RELEASES_CHECK_URL,
|
url: $scope.appInfo.APP_RELEASES_CHECK_URL,
|
||||||
method: 'GET'
|
method: 'GET'
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
let releaseVersion = response.data[0].tag_name
|
let releaseTag = response.data[0].tag_name
|
||||||
if (releaseVersion == $scope.appInfo.APP_VERSION) {
|
let releaseVersion = parseInt(releaseTag.replace(/v|\./g, ''))
|
||||||
$scope.checkingForUpdate = 'latest'
|
let appVersion = parseInt($scope.appInfo.APP_VERSION.replace(/v|\./g, ''))
|
||||||
|
if (appVersion < releaseVersion ) {
|
||||||
|
$scope.checkingForUpdate = 'updateAvailable'
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$scope.checkingForUpdate = 'updateAvailable'
|
$scope.checkingForUpdate = 'latest'
|
||||||
}
|
}
|
||||||
}, (error) => {
|
}, (error) => {
|
||||||
$scope.checkingForUpdate = 'checkErr'
|
$scope.checkingForUpdate = 'checkErr'
|
||||||
|
|
Loading…
Reference in New Issue