wallet details refactor

This commit is contained in:
Ivan Socolsky 2016-08-18 10:37:08 -03:00
commit 8aefbe25b3
No known key found for this signature in database
GPG key ID: FAECE6A05FAA4F56
9 changed files with 703 additions and 706 deletions

View file

@ -88,11 +88,9 @@ angular.module('copayApp.controllers').controller('tabHomeController',
self.updateAllClients = function() {
var txps = [];
var wallets = profileService.getWallets();
var l = wallets.length,
i = 0;
var i = $scope.wallets.length;
lodash.each(wallets, function(wallet) {
lodash.each($scope.wallets, function(wallet) {
walletService.getStatus(wallet, {}, function(err, status) {
if (err) {
console.log('[tab-home.js.35:err:]', $log.error(err)); //TODO
@ -101,9 +99,10 @@ angular.module('copayApp.controllers').controller('tabHomeController',
if (status.pendingTxps && status.pendingTxps[0]) {
txps = txps.concat(status.pendingTxps);
}
if (++i == l) {
if (--i == 0) {
setPendingTxps(txps);
}
wallet.status = status;
});
});
}