Alert when incoming transaction (not proposal)

This commit is contained in:
Gustavo Cortez 2014-05-20 14:31:00 -03:00
parent 70cae4135f
commit edb3e75800
3 changed files with 13 additions and 0 deletions

View File

@ -29,6 +29,12 @@ angular.module('copay.header').controller('HeaderController',
}
});
$rootScope.$watch('receivedFund', function(receivedFund) {
if (receivedFund) {
$notification.funds('Received fund', 'on ' + receivedFund[1], receivedFund);
}
});
$scope.isActive = function(item) {
if (item.link && item.link.replace('#','') == $location.path()) {
return true;

View File

@ -192,6 +192,7 @@ angular.module('copay.controllerUtils')
newAddrs.forEach(function(addr) {
Socket.on(addr, function(txid) {
console.log('Received!', txid);
$rootScope.receivedFund = [txid, addr];
root.updateBalance(function(){
$rootScope.$digest();
});

View File

@ -9,6 +9,7 @@ angular.module('notifications', []).
var settings = {
info: { duration: 5000, enabled: true },
funds: { duration: 5000, enabled: true },
warning: { duration: 5000, enabled: true },
error: { duration: 5000, enabled: true },
success: { duration: 5000, enabled: true },
@ -115,6 +116,11 @@ angular.module('notifications', []).
console.log(title, content);
return this.awesomeNotify('info','loop', title, content, userData);
},
funds: function(title, content, userData){
console.log(title, content);
return this.awesomeNotify('funds','bitcoin', title, content, userData);
},
error: function(title, content, userData){
return this.awesomeNotify('error', 'remove', title, content, userData);