Skip to content

Commit c29c681

Browse files
committed
bug when switching walelts
1 parent a27eca4 commit c29c681

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/js/controllers/walletHome.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,21 @@ angular.module('copayApp.controllers')
532532
});
533533
}
534534
$rootScope.$on('claimTextcoin', function(event, mnemonic) {
535-
claimTextCoin(mnemonic, self.addr[profileService.focusedClient.credentials.walletId]);
535+
var addr = self.addr[profileService.focusedClient.credentials.walletId];
536+
if (addr) {
537+
claimTextCoin(mnemonic, addr);
538+
} else {
539+
addressService.getAddress(profileService.focusedClient.credentials.walletId, false, function(err, addr) {
540+
if (addr) {
541+
self.addr[profileService.focusedClient.credentials.walletId] = addr;
542+
claimTextCoin(mnemonic, addr);
543+
}
544+
545+
$timeout(function() {
546+
$scope.$digest();
547+
});
548+
});
549+
}
536550
});
537551

538552
// Send

0 commit comments

Comments
 (0)