Merge pull request #451 from colkito/fix/user-friendly-insight-error-message

Fix/user friendly insight error message
This commit is contained in:
Gustavo Maximiliano Cortez 2014-05-22 16:42:45 +03:00
commit 41aac17688
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;