UX: just update address balance that received fund.

Changed rootscope for scope to control address page.
Fixes: not alert when address change receive fund
This commit is contained in:
Gustavo Cortez 2014-05-20 19:40:02 -03:00
commit 9428ea55d5
4 changed files with 80 additions and 26 deletions

View file

@ -31,7 +31,17 @@ angular.module('copay.header').controller('HeaderController',
$rootScope.$watch('receivedFund', function(receivedFund) {
if (receivedFund) {
$notification.funds('Received fund', 'on ' + receivedFund[1], receivedFund);
var currentAddr;
for(var i=0;i<$rootScope.addrInfos.length;i++) {
var addrinfo = $rootScope.addrInfos[i];
if (addrinfo.address.toString() == receivedFund[1] && !addrinfo.isChange) {
currentAddr = addrinfo.address.toString();
break;
}
}
if (currentAddr) {
$notification.funds('Received fund', currentAddr, receivedFund);
}
}
});