Merge pull request #2191 from isocolsky/send_error

Give feedback when email cannot be verified (as per Insight)
This commit is contained in:
Matias Alejo Garcia 2014-12-18 19:18:46 -03:00
commit f886e36481
5 changed files with 9 additions and 7 deletions

View file

@ -120,6 +120,10 @@ angular.module('copayApp.controllers').controller('CreateProfileController', fun
msg = 'This profile already exists' msg = 'This profile already exists'
$scope.createStep = 'email'; $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; $scope.error = msg;
} else { } else {
// mobile // mobile

View file

@ -381,12 +381,9 @@ Identity.prototype.store = function(opts, cb) {
var storeFunction = opts.failIfExists ? self.storage.createItem : self.storage.setItem; var storeFunction = opts.failIfExists ? self.storage.createItem : self.storage.setItem;
storeFunction.call(self.storage, this.getId(), this.toObj(), function(err) { storeFunction.call(self.storage, this.getId(), this.toObj(), function(err) {
if (err) { if (err) return cb(err);
return cb(err);
}
if (opts.noWallets) if (opts.noWallets) return cb();
return cb();
async.each(self.getWallets(), function(wallet, in_cb) { async.each(self.getWallets(), function(wallet, in_cb) {
self.storeWallet(wallet, in_cb); self.storeWallet(wallet, in_cb);

View file

@ -223,6 +223,8 @@ InsightStorage.prototype.setItem = function(name, value, callback) {
return callback('BADCREDENTIALS: Invalid username or password'); return callback('BADCREDENTIALS: Invalid username or password');
} else if (response.statusCode === 406) { } else if (response.statusCode === 406) {
return callback('OVERQUOTA: Quota exceeded'); return callback('OVERQUOTA: Quota exceeded');
} else if (response.statusCode === 501) {
return callback('EMAILERROR: Error sending verification email');
} else if (response.statusCode !== 200) { } else if (response.statusCode !== 200) {
return callback('Unable to store data on insight'); return callback('Unable to store data on insight');
} }

View file

@ -31,7 +31,7 @@ angular.module('copayApp.services').factory('configService', function($timeout,
}; };
root.reset = function(cb) { root.reset = function(cb) {
config = defauls; config = defaults;
localstorageService.removeItem('config', cb); localstorageService.removeItem('config', cb);
}; };

View file

@ -37,7 +37,6 @@ angular.module('copayApp.services')
passphraseConfig: config.passphraseConfig, passphraseConfig: config.passphraseConfig,
failIfExists: true, failIfExists: true,
}, function(err, iden) { }, function(err, iden) {
if (err) return cb(err); if (err) return cb(err);
preconditions.checkState(iden); preconditions.checkState(iden);
root.bind(iden); root.bind(iden);