add client check

This commit is contained in:
Matias Alejo Garcia 2016-06-13 08:37:14 -03:00
commit 487e372889
No known key found for this signature in database
GPG key ID: 02470DB551277AB3
3 changed files with 10 additions and 1 deletions

View file

@ -3,7 +3,6 @@
angular.module('copayApp.controllers').controller('buyCoinbaseController',
function($scope, $modal, $log, $ionicModal, $timeout, lodash, profileService, coinbaseService, bwsError, addressService) {
var self = this;
var fc;
this.init = function(testnet) {
self.allWallets = profileService.getWallets(testnet ? 'testnet' : 'livenet', 1)

View file

@ -142,6 +142,11 @@ angular.module('copayApp.controllers').controller('sellCoinbaseController',
this.createTx = function(token, account, amount) {
self.error = null;
if (!client) {
self.error = 'No wallet selected';
return;
}
var accountId = account.id;
var dataSrc = {
name: 'Received from Copay: ' + self.selectedWalletName

View file

@ -94,6 +94,11 @@ angular.module('copayApp.controllers').controller('sellGlideraController',
var configWallet = config.wallet;
var walletSettings = configWallet.settings;
if (!client) {
self.error = 'No wallet selected';
return;
}
addressService.getAddress(client.credentials.walletId, null, function(err, refundAddress) {
if (!refundAddress) {
self.loading = null;