diff --git a/index.html b/index.html index df53bdefd..4c460e1ca 100644 --- a/index.html +++ b/index.html @@ -81,15 +81,6 @@ -
-
-
- A newer version of Copay is now available ({{updateVersion.version}}), please update your wallet. - Check Copay.io for details. -
-
-
-
diff --git a/js/controllers/header.js b/js/controllers/header.js index 52e0bb352..803c3cec6 100644 --- a/js/controllers/header.js +++ b/js/controllers/header.js @@ -30,16 +30,14 @@ angular.module('copayApp.controllers').controller('HeaderController', }; 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]) { - $scope.updateVersion = { - class: 'error', - version: data[0].name - }; + 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]) { - $scope.updateVersion = { - class: 'info', - version: data[0].name - }; + var content = 'Please update your wallet at https://copay.io'; + notification.version(title, content, false); } }); diff --git a/js/services/notifications.js b/js/services/notifications.js index e8f9bda2c..4c3c00e4b 100644 --- a/js/services/notifications.js +++ b/js/services/notifications.js @@ -16,6 +16,10 @@ factory('notification', ['$timeout', duration: 5000, enabled: true }, + version: { + duration: 60000, + enabled: true + }, warning: { duration: 5000, enabled: true @@ -135,6 +139,10 @@ factory('notification', ['$timeout', return this.awesomeNotify('funds', 'bitcoin', title, content, userData); }, + version: function(title, content, severe) { + return this.awesomeNotify('version', severe ? 'alert' : 'flag', title, content); + }, + error: function(title, content, userData) { return this.awesomeNotify('error', 'x', title, content, userData); },