many optimizations in addresses pulling

This commit is contained in:
Matias Alejo Garcia 2014-05-16 18:33:06 -03:00
commit 398daf3f05
9 changed files with 183 additions and 130 deletions

View file

@ -2,15 +2,17 @@
angular.module('copay.addresses').controller('AddressesController',
function($scope, $rootScope, controllerUtils) {
var w = $rootScope.wallet;
$scope.loading = false;
var w = $rootScope.wallet;
$scope.newAddr = function() {
$scope.loading = true;
w.generateAddress();
controllerUtils.updateBalance(function() {
$scope.loading = false;
$scope.loading=true;
w.generateAddress(null, function() {
setTimeout(function() {
controllerUtils.setSocketHandlers();
controllerUtils.updateAddressList();
$scope.loading=false;
$rootScope.$digest();
},1);
});
};