Merge pull request #4496 from cmgustavo/bug/wallet-incomplete-01

Fix js error when selecting an incomplete wallet
This commit is contained in:
Gustavo Maximiliano Cortez 2016-06-24 11:34:43 -03:00 committed by GitHub
commit 50173daab3
2 changed files with 5 additions and 5 deletions

View File

@ -25,7 +25,8 @@ angular.module('copayApp.controllers').controller('sidebarController',
};
self.switchWallet = function(selectedWalletId, currentWalletId) {
if (selectedWalletId == currentWalletId) return;
var client = profileService.focusedClient;
if (selectedWalletId == currentWalletId && client.isComplete()) return;
self.walletSelection = false;
profileService.setAndStoreFocus(selectedWalletId, function() {});
$ionicScrollDelegate.scrollTop();

View File

@ -174,9 +174,8 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
this.setAddress = function(forceNew) {
self.addrError = null;
var fc = profileService.focusedClient;
if (!fc)
return;
var client = profileService.focusedClient;
if (!client || !client.isComplete()) return;
// Address already set?
if (!forceNew && self.addr) {
@ -185,7 +184,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
self.generatingAddress = true;
$timeout(function() {
addressService.getAddress(fc.credentials.walletId, forceNew, function(err, addr) {
addressService.getAddress(client.credentials.walletId, forceNew, function(err, addr) {
self.generatingAddress = false;
if (err) {