From 36692f426959181387e9b820080aa66a19257182 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Tue, 9 Aug 2016 09:57:40 -0300 Subject: [PATCH] Show error when selecting a not ready wallet --- src/js/controllers/modals/addressbook.js | 6 +++--- src/js/controllers/modals/wallets.js | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/js/controllers/modals/addressbook.js b/src/js/controllers/modals/addressbook.js index 3b6dee56b..23d448755 100644 --- a/src/js/controllers/modals/addressbook.js +++ b/src/js/controllers/modals/addressbook.js @@ -132,9 +132,6 @@ angular.module('copayApp.controllers').controller('addressbookController', funct else { $scope.gettingAddress = true; $scope.selectedWalletName = walletName; - $timeout(function() { - $scope.$apply(); - }); addressService.getAddress(walletId, false, function(err, addr) { $scope.gettingAddress = false; @@ -148,6 +145,9 @@ angular.module('copayApp.controllers').controller('addressbookController', funct $scope.cancel(); }); } + $timeout(function() { + $scope.$apply(); + }); }); }; diff --git a/src/js/controllers/modals/wallets.js b/src/js/controllers/modals/wallets.js index d871e9218..c8552501b 100644 --- a/src/js/controllers/modals/wallets.js +++ b/src/js/controllers/modals/wallets.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('walletsController', function($scope, bwcError, profileService) { +angular.module('copayApp.controllers').controller('walletsController', function($scope, $timeout, bwcError, profileService) { $scope.selectWallet = function(walletId) { @@ -10,6 +10,9 @@ angular.module('copayApp.controllers').controller('walletsController', function( profileService.isReady(client, function(err) { if (err) { $scope.errorSelectedWallet[walletId] = bwcError.msg(err); + $timeout(function() { + $scope.$apply(); + }); return; }