txaction event

This commit is contained in:
Matias Alejo Garcia 2016-08-23 12:41:41 -03:00
commit 47d424af11
No known key found for this signature in database
GPG key ID: 02470DB551277AB3

View file

@ -103,12 +103,12 @@ angular.module('copayApp.controllers').controller('tabHomeController',
self.updateWallet = function(wallet) { self.updateWallet = function(wallet) {
$log.debug('Updating wallet:'+ wallet.name) $log.debug('Updating wallet:' + wallet.name)
walletService.getStatus(wallet, {}, function(err, status) { walletService.getStatus(wallet, {}, function(err, status) {
if (err) { if (err) {
console.log('[tab-home.js.35:err:]', $log.error(err)); //TODO console.log('[tab-home.js.35:err:]', $log.error(err)); //TODO
return; return;
} }
if (status.pendingTxps && status.pendingTxps[0]) { if (status.pendingTxps && status.pendingTxps[0]) {
var txps = lodash.filter($scope.txps, function(x) { var txps = lodash.filter($scope.txps, function(x) {
return x.walletId != wallet.id; return x.walletId != wallet.id;
@ -127,13 +127,21 @@ angular.module('copayApp.controllers').controller('tabHomeController',
self.updateAllWallets(); self.updateAllWallets();
$scope.bitpayCardEnabled = true; // TODO $scope.bitpayCardEnabled = true; // TODO
var c1 = $rootScope.$on('bwsEvent', function(e, walletId, type, n) { var listeners = [
var wallet = profileService.getWallet(walletId); $rootScope.$on('bwsEvent', function(e, walletId, type, n) {
self.updateWallet(wallet); var wallet = profileService.getWallet(walletId);
}); self.updateWallet(wallet);
}),
$rootScope.$on('Local/TxAction', function(e, walletId, type, n) {
var wallet = profileService.getWallet(walletId);
self.updateWallet(wallet);
}),
];
$scope.$on('$destroy', function() { $scope.$on('$destroy', function() {
c1(); lodash.each(listeners, function(x){
x();
});
}); });
var config = configService.getSync().wallet; var config = configService.getSync().wallet;