Fixes problem with gitignore

This commit is contained in:
Gustavo Maximiliano Cortez 2014-08-06 15:36:13 -03:00
parent bb587d0743
commit 7fd642c8ac
2 changed files with 27 additions and 0 deletions

1
.gitignore vendored
View File

@ -48,6 +48,7 @@ browser-extensions/firefox/firefox-addon
browser-extensions/firefox/data
browser-extensions/firefox/copay.xpi
version.js
!js/controllers/version.js
android/package
android/*.apk

26
js/controllers/version.js Normal file
View 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);
}
});
});