mirror of https://github.com/BTCPrivate/copay.git
Add warning message on new Copay version
This commit is contained in:
parent
588e295c1b
commit
329a48b354
|
@ -73,6 +73,15 @@
|
|||
|
||||
</div>
|
||||
|
||||
<div class="row" ng-if="updateVersion">
|
||||
<div class="small-9 large-centered columns">
|
||||
<div data-alert class="alert-box radius {{updateVersion}}">
|
||||
A newer version of Copay is now available, please update your wallet to a latest version.
|
||||
Please check <a href="http://www.copay.io">Copay.io</a>.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" ng-if='$root.$flashMessage.message' notification>
|
||||
<div class="small-8 large-centered columns">
|
||||
<div data-alert class="alert-box radius {{$root.$flashMessage.type}}">
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copay.header').controller('HeaderController',
|
||||
function($scope, $rootScope, $location, $notification, walletFactory, controllerUtils) {
|
||||
function($scope, $rootScope, $location, $notification, $http, walletFactory, controllerUtils) {
|
||||
$scope.menu = [
|
||||
{
|
||||
'title': 'Addresses',
|
||||
|
@ -23,6 +23,18 @@ angular.module('copay.header').controller('HeaderController',
|
|||
|
||||
var beep = new Audio('sound/transaction.mp3');
|
||||
|
||||
$http.get('https://api.github.com/repos/bitpay/copay/tags').success(function(data){
|
||||
var toInt = function (s) { return parseInt(s); };
|
||||
var latestVersion = data[0].name.replace('v', '').split('.').map(toInt);
|
||||
var currentVersion = copay.version.split('.').map(toInt);
|
||||
|
||||
if (currentVersion[0] < latestVersion[0]){
|
||||
$scope.updateVersion = 'error';
|
||||
} else if (currentVersion[0] == latestVersion[0] && currentVersion[1] < latestVersion[1]) {
|
||||
$scope.updateVersion = 'info';
|
||||
}
|
||||
});
|
||||
|
||||
// Initialize alert notification (not show when init wallet)
|
||||
$rootScope.txAlertCount = 0;
|
||||
$rootScope.$watch('txAlertCount', function(txAlertCount) {
|
||||
|
|
Loading…
Reference in New Issue