mirror of https://github.com/BTCPrivate/copay.git
Merge pull request #4496 from cmgustavo/bug/wallet-incomplete-01
Fix js error when selecting an incomplete wallet
This commit is contained in:
commit
50173daab3
|
@ -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();
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue