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) {
|
self.switchWallet = function(selectedWalletId, currentWalletId) {
|
||||||
if (selectedWalletId == currentWalletId) return;
|
var client = profileService.focusedClient;
|
||||||
|
if (selectedWalletId == currentWalletId && client.isComplete()) return;
|
||||||
self.walletSelection = false;
|
self.walletSelection = false;
|
||||||
profileService.setAndStoreFocus(selectedWalletId, function() {});
|
profileService.setAndStoreFocus(selectedWalletId, function() {});
|
||||||
$ionicScrollDelegate.scrollTop();
|
$ionicScrollDelegate.scrollTop();
|
||||||
|
|
|
@ -174,9 +174,8 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
|
|
||||||
this.setAddress = function(forceNew) {
|
this.setAddress = function(forceNew) {
|
||||||
self.addrError = null;
|
self.addrError = null;
|
||||||
var fc = profileService.focusedClient;
|
var client = profileService.focusedClient;
|
||||||
if (!fc)
|
if (!client || !client.isComplete()) return;
|
||||||
return;
|
|
||||||
|
|
||||||
// Address already set?
|
// Address already set?
|
||||||
if (!forceNew && self.addr) {
|
if (!forceNew && self.addr) {
|
||||||
|
@ -185,7 +184,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
|
|
||||||
self.generatingAddress = true;
|
self.generatingAddress = true;
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
addressService.getAddress(fc.credentials.walletId, forceNew, function(err, addr) {
|
addressService.getAddress(client.credentials.walletId, forceNew, function(err, addr) {
|
||||||
self.generatingAddress = false;
|
self.generatingAddress = false;
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
Loading…
Reference in New Issue