diff --git a/js/controllers/createProfile.js b/js/controllers/createProfile.js index 4e211ecb7..3f15df04b 100644 --- a/js/controllers/createProfile.js +++ b/js/controllers/createProfile.js @@ -120,6 +120,10 @@ angular.module('copayApp.controllers').controller('CreateProfileController', fun msg = 'This profile already exists' $scope.createStep = 'email'; } + if (msg.indexOf('EMAILERROR') >= 0) { + msg = 'Could not send verification email. Please check your email address.'; + $scope.createStep = 'email'; + } $scope.error = msg; } else { // mobile diff --git a/js/models/Identity.js b/js/models/Identity.js index 4ed14f0db..51d8c4191 100644 --- a/js/models/Identity.js +++ b/js/models/Identity.js @@ -381,12 +381,9 @@ Identity.prototype.store = function(opts, cb) { var storeFunction = opts.failIfExists ? self.storage.createItem : self.storage.setItem; storeFunction.call(self.storage, this.getId(), this.toObj(), function(err) { - if (err) { - return cb(err); - } + if (err) return cb(err); - if (opts.noWallets) - return cb(); + if (opts.noWallets) return cb(); async.each(self.getWallets(), function(wallet, in_cb) { self.storeWallet(wallet, in_cb); diff --git a/js/plugins/InsightStorage.js b/js/plugins/InsightStorage.js index cb8ec6fc4..b05dd338b 100644 --- a/js/plugins/InsightStorage.js +++ b/js/plugins/InsightStorage.js @@ -223,6 +223,8 @@ InsightStorage.prototype.setItem = function(name, value, callback) { return callback('BADCREDENTIALS: Invalid username or password'); } else if (response.statusCode === 406) { return callback('OVERQUOTA: Quota exceeded'); + } else if (response.statusCode === 501) { + return callback('EMAILERROR: Error sending verification email'); } else if (response.statusCode !== 200) { return callback('Unable to store data on insight'); } diff --git a/js/services/configService.js b/js/services/configService.js index 41c2de9dc..b08077898 100644 --- a/js/services/configService.js +++ b/js/services/configService.js @@ -31,7 +31,7 @@ angular.module('copayApp.services').factory('configService', function($timeout, }; root.reset = function(cb) { - config = defauls; + config = defaults; localstorageService.removeItem('config', cb); }; diff --git a/js/services/identityService.js b/js/services/identityService.js index e7a993213..2f226ff8a 100644 --- a/js/services/identityService.js +++ b/js/services/identityService.js @@ -37,7 +37,6 @@ angular.module('copayApp.services') passphraseConfig: config.passphraseConfig, failIfExists: true, }, function(err, iden) { - if (err) return cb(err); preconditions.checkState(iden); root.bind(iden);