show status balance

This commit is contained in:
Ivan Socolsky 2016-08-17 18:48:30 -03:00
commit e3076d18ab
No known key found for this signature in database
GPG key ID: FAECE6A05FAA4F56
4 changed files with 90 additions and 88 deletions

View file

@ -93,11 +93,10 @@ angular.module('copayApp.controllers').controller('tabHomeController',
i = 0;
lodash.each(wallets, function(wallet) {
walletService.updateStatus(wallet, {}, function(err) {
var status = wallet.status;
walletService.getStatus(wallet, {}, function(err, status) {
if (err) {
console.log('[tab-home.js.35:err:]',$log.error(err)); //TODO
return;
console.log('[tab-home.js.35:err:]', $log.error(err)); //TODO
return;
} // TODO
if (status.pendingTxps && status.pendingTxps[0]) {
txps = txps.concat(status.pendingTxps);

View file

@ -61,12 +61,21 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
});
};
$scope.updateAll = function()  {
$scope.update();
}
$scope.update = function() {
walletService.updateStatus(wallet, {
force: true
}, function(err, status) {
if (err) {} // TODO
});
$scope.updating = true;
$timeout(function() {
walletService.getStatus(wallet, {
force: true
}, function(err, status) {
if (err) {} // TODO
$scope.status = status;
$scope.updating = false;
});
})
};
$scope.hideToggle = function() {
@ -85,9 +94,15 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
$scope.wallet = wallet;
if (wallet) {
walletService.updateStatus(wallet, {}, function(err, status) {
console.log(status);
walletService.getStatus(wallet, {}, function(err, status) {
console.log('*** [walletDetails.js ln89] status:', status); // TODO
if (err) {} // TODO
$scope.status = status;
});
walletService.getHistory(wallet, {}, function(err, txHistory) {
console.log('*** [walletDetails.js ln93] txHistory:', txHistory); // TODO
if (err) {} // TODO
$scope.txHistory = txHistory;
});
}
});