added a user friendly message when insight doesnt work

This commit is contained in:
Mario Colque 2014-05-21 18:03:11 -03:00
commit 6c973d7f88
3 changed files with 62 additions and 25 deletions

View file

@ -114,7 +114,19 @@ angular.module('copay.controllerUtils')
$rootScope.balanceByAddr = {};
$rootScope.updatingBalance = true;
w.getBalance(function(balance, balanceByAddr, safeBalance) {
w.getBalance(function(err, balance, balanceByAddr, safeBalance) {
if (err) {
$rootScope.$flashMessage = {
type: 'error',
message: 'Error: ' + err.message
};
$rootScope.$digest();
console.error('Error: ' + err.message); //TODO
return null;
}
$rootScope.totalBalance = balance;
$rootScope.balanceByAddr = balanceByAddr;
$rootScope.availableBalance = safeBalance;