Merge pull request #452 from cmgustavo/bug/01-refresh
Fix refresh button
This commit is contained in:
commit
41dadab915
4 changed files with 17 additions and 14 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue