Fixes problem with gitignore
This commit is contained in:
parent
bb587d0743
commit
7fd642c8ac
2 changed files with 27 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -48,6 +48,7 @@ browser-extensions/firefox/firefox-addon
|
||||||
browser-extensions/firefox/data
|
browser-extensions/firefox/data
|
||||||
browser-extensions/firefox/copay.xpi
|
browser-extensions/firefox/copay.xpi
|
||||||
version.js
|
version.js
|
||||||
|
!js/controllers/version.js
|
||||||
|
|
||||||
android/package
|
android/package
|
||||||
android/*.apk
|
android/*.apk
|
||||||
|
|
|
||||||
26
js/controllers/version.js
Normal file
26
js/controllers/version.js
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
angular.module('copayApp.controllers').controller('VersionController',
|
||||||
|
function($scope, $rootScope, $http, notification) {
|
||||||
|
|
||||||
|
$scope.version = copay.version;
|
||||||
|
$scope.networkName = config.networkName;
|
||||||
|
|
||||||
|
$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);
|
||||||
|
var title = 'Copay ' + data[0].name + ' available.';
|
||||||
|
var content;
|
||||||
|
if (currentVersion[0] < latestVersion[0]) {
|
||||||
|
content = 'It\'s important that you update your wallet at https://copay.io';
|
||||||
|
notification.version(title, content, true);
|
||||||
|
} else if (currentVersion[0] == latestVersion[0] && currentVersion[1] < latestVersion[1]) {
|
||||||
|
var content = 'Please update your wallet at https://copay.io';
|
||||||
|
notification.version(title, content, false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
Loading…
Add table
Add a link
Reference in a new issue