txaction event
This commit is contained in:
parent
2897aa3e4c
commit
47d424af11
1 changed files with 15 additions and 7 deletions
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue