Adds support for 2-step balance

This commit is contained in:
Gustavo Maximiliano Cortez 2016-01-13 12:08:13 -03:00
commit 79f61c29f8
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
4 changed files with 9 additions and 3 deletions

View file

@ -300,7 +300,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
return cb(null, opts.walletStatus);
else {
self.updateError = false;
return fc.getStatus({}, function(err, ret) {
return fc.getStatus({ twoStep : true }, function(err, ret) {
if (err) {
self.updateError = bwsError.msg(err, gettext('Could not update Wallet'));
} else {
@ -1339,6 +1339,9 @@ angular.module('copayApp.controllers').controller('indexController', function($r
}
});
$rootScope.$on('BalanceUpdated', function(e, n) {
self.setBalance(n.data);
});
$rootScope.$on('NewOutgoingTx', function() {
self.newTx = true;

View file

@ -26,7 +26,7 @@ angular.module('copayApp.services')
$log.debug('Creating address for wallet:', walletId);
client.createAddress(function(err, addr) {
client.createAddress({}, function(err, addr) {
if (err) {
var prefix = gettextCatalog.getString('Could not create address');
if (err.error && err.error.match(/locked/gi)) {

View file

@ -91,6 +91,9 @@ angular.module('copayApp.services')
case 'NewCopayer':
// No UX notification
break;
case 'BalanceUpdated':
// No UX notification
break;
}
};

View file

@ -81,7 +81,7 @@ angular.module('copayApp.services')
client.credentials.walletId, client.credentials.walletName);
if (root.focusedClient.credentials.walletId == client.credentials.walletId) {
$rootScope.$emit(n.type);
$rootScope.$emit(n.type, n);
} else {
$rootScope.$apply();
}