Merge pull request #452 from cmgustavo/bug/01-refresh

Fix refresh button
This commit is contained in:
Mario Colque 2014-05-22 16:59:25 +03:00
commit 41dadab915
4 changed files with 17 additions and 14 deletions

View file

@ -20,12 +20,13 @@ angular.module('copay.addresses').controller('AddressesController',
$scope.selectedAddr = addr;
};
$rootScope.$watch('addrInfos', function(addrInfos) {
$scope.addressList(addrInfos);
$rootScope.$watch('addrInfos', function() {
$scope.addressList();
});
$scope.addressList = function (addrInfos) {
$scope.addressList = function () {
$scope.addresses = [];
var addrInfos = $rootScope.addrInfos;
if (addrInfos) {
for(var i=0;i<addrInfos.length;i++) {
var addrinfo = addrInfos[i];
@ -36,6 +37,8 @@ angular.module('copay.addresses').controller('AddressesController',
});
}
$scope.selectedAddr = $scope.addresses[0];
$scope.addrWithFund = $rootScope.receivedFund ? $rootScope.receivedFund[1] : null;
$rootScope.receivedFund = null;
}
}

View file

@ -63,9 +63,11 @@ angular.module('copay.header').controller('HeaderController',
$scope.refresh = function() {
var w = $rootScope.wallet;
w.connectToAll();
controllerUtils.updateBalance(function() {
$rootScope.$digest();
});
if ($rootScope.addrInfos.length > 0 ) {
controllerUtils.updateBalance(function() {
$rootScope.$digest();
});
}
};
$scope.clearFlashMessage = function() {