diff --git a/index.html b/index.html index b553aa377..486514def 100644 --- a/index.html +++ b/index.html @@ -55,8 +55,8 @@ - {{item.title}} - ({{$root.txslength}}) + {{item.title}} + {{$root.txslength}} diff --git a/js/controllers/transactions.js b/js/controllers/transactions.js index 2e083f2ae..26f948cbc 100644 --- a/js/controllers/transactions.js +++ b/js/controllers/transactions.js @@ -16,6 +16,7 @@ angular.module('copay.transactions').controller('TransactionsController', : {type:'error', message: 'There was an error sending the Transaction'} ; controllerUtils.updateTxs(); + $scope.loading = false; $rootScope.$digest(); }); }; @@ -28,15 +29,18 @@ angular.module('copay.transactions').controller('TransactionsController', if (!ret) { $rootScope.flashMessage = {type:'error', message: 'There was an error signing the Transaction'}; controllerUtils.updateTxs(); - $rootScope.$digest(); + $scope.loading = false; + $rootScope.$digest(); return; } var p = w.txProposals.getTxProposal(ntxid); if (p.builder.isFullySigned()) { $scope.send(ntxid); + controllerUtils.updateTxs(); } else { controllerUtils.updateTxs(); + $scope.loading = false; $rootScope.$digest(); } }; @@ -64,8 +68,7 @@ angular.module('copay.transactions').controller('TransactionsController', var w = $rootScope.wallet; w.reject(ntxid); $rootScope.flashMessage = {type:'warning', message: 'Transaction rejected by you'}; - controllerUtils.updateTxs(); -// $rootScope.$digest(); + $scope.loading = false; }; }); diff --git a/js/models/core/Wallet.js b/js/models/core/Wallet.js index 27225bb8a..efae39e0b 100644 --- a/js/models/core/Wallet.js +++ b/js/models/core/Wallet.js @@ -346,7 +346,7 @@ Wallet.prototype.reject = function(ntxid) { txp.rejectedBy[myId] = Date.now(); this.sendTxProposals(); this.store(); - this.emit('refresh'); + this.emit('txProposalsUpdated'); }; @@ -367,7 +367,7 @@ Wallet.prototype.sign = function(ntxid) { txp.signedBy[myId] = Date.now(); this.sendTxProposals(); this.store(); - this.emit('refresh'); + this.emit('txProposalsUpdated'); return true; } return false; diff --git a/js/services/controllerUtils.js b/js/services/controllerUtils.js index addde1589..e3ad7e0a5 100644 --- a/js/services/controllerUtils.js +++ b/js/services/controllerUtils.js @@ -85,6 +85,7 @@ angular.module('copay.controllerUtils') w.on('txProposalsUpdated', function() { console.log('[ txProposalsUpdated ]'); //TODO root.updateTxs(); + root.updateBalance(); }); w.on('openError', root.onErrorDigest); w.on('connect', function(peerID) { @@ -153,8 +154,13 @@ angular.module('copay.controllerUtils') txs.push(i); }); $rootScope.txs = txs; -console.log('[controllerUtils.js:155]',txs); //TODO - $rootScope.txslength = txs.length; + var txps = 0; + for(var i=0; i