adds errorCb, handles blocks

This commit is contained in:
Matias Alejo Garcia 2015-08-12 08:57:44 -03:00
commit fe07348a5a
3 changed files with 37 additions and 2 deletions

View file

@ -63,6 +63,9 @@ angular.module('copayApp.controllers').controller('createController',
if (err) {
$log.debug(err);
self.error = err;
$timeout(function() {
$rootScope.$apply();
});
}
else {
go.walletHome();

View file

@ -960,6 +960,9 @@ angular.module('copayApp.controllers').controller('indexController', function($r
trailing: true
});
self.debouncedUpdateHistory = lodash.throttle(function() {
self.updateTxHistory();
}, 60000);
$rootScope.$on('Local/Resume', function(event) {
$log.debug('### Resume event');
@ -1023,6 +1026,20 @@ angular.module('copayApp.controllers').controller('indexController', function($r
});
});
$rootScope.$on('NewBlock', function() {
if (self.pendingAmount) {
self.updateAll();
}
if (self.network =='testnet') {
self.debouncedUpdateHistory();
} else {
self.updateTxHistory();
}
});
$rootScope.$on('NewOutgoingTx', function() {
self.updateAll({
walletStatus: null,