balance Service

This commit is contained in:
Matias Alejo Garcia 2014-11-29 18:35:48 -03:00
commit 57299d675e
31 changed files with 585 additions and 645 deletions

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('HeadController', function($scope, $rootScope, $filter, $timeout, notification, controllerUtils) {
angular.module('copayApp.controllers').controller('HeadController', function($scope, $rootScope, $filter, $timeout, notification, identityService, balanceService) {
$scope.username = $rootScope.iden.getName();
$scope.hoverMenu = false;
@ -14,7 +14,7 @@ angular.module('copayApp.controllers').controller('HeadController', function($sc
$scope.signout = function() {
$rootScope.signingOut = true;
controllerUtils.logout();
identityService.logout();
};
$scope.refresh = function() {
@ -23,12 +23,10 @@ angular.module('copayApp.controllers').controller('HeadController', function($sc
if (w.isReady()) {
w.sendWalletReady();
if ($rootScope.addrInfos.length > 0) {
controllerUtils.clearBalanceCache(w);
controllerUtils.updateBalance(w, function() {
$rootScope.$digest();
});
}
balanceService.clearBalanceCache(w);
balanceService.update(w, function() {
$rootScope.$digest();
}, true);
}
};