fix err message

This commit is contained in:
Matias Alejo Garcia 2016-06-07 12:34:16 -03:00
commit d621c9601b
No known key found for this signature in database
GPG key ID: 02470DB551277AB3

View file

@ -324,7 +324,8 @@ angular.module('copayApp.services')
opts.network = 'livenet';
doCreateWallet(opts, function(err, walletClient) {
if (err) return bwsError.cb(err, gettext('Error creating wallet'), cb);
if (err) return cb(err);
p.addWallet(JSON.parse(walletClient.export()));
return cb(null, p);
});
@ -333,6 +334,8 @@ angular.module('copayApp.services')
// create and store a wallet
root.createWallet = function(opts, cb) {
doCreateWallet(opts, function(err, walletClient, secret) {
if (err) return cb(err);
root.addAndBindWalletClient(walletClient, {
bwsurl: opts.bwsurl
}, cb);
@ -431,6 +434,9 @@ angular.module('copayApp.services')
// Adds and bind a new client to the profile
root.addAndBindWalletClient = function(client, opts, cb) {
if (!client || !client.credentials)
return cb(gettext('Could not access wallet'));
var walletId = client.credentials.walletId
if (!root.profile.addWallet(JSON.parse(client.export())))