Merge pull request #484 from colkito/fix/backup-email-validation

email validation
This commit is contained in:
Gustavo Maximiliano Cortez 2014-05-29 10:25:45 -03:00
commit 769238165f
1 changed files with 4 additions and 4 deletions

View File

@ -22,10 +22,10 @@ angular.module('copay.backup').controller('BackupController',
var email = prompt('Please enter your email addres.');
var mailformat = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
if (!email.match(mailformat)) {
alert('Enter a valid email address');
} else {
if (email && email !== '') {
if (email && email !== '') {
if (!email.match(mailformat)) {
alert('Enter a valid email address');
} else {
var body = _getEncryptedWallet();
var subject = ($rootScope.wallet.name ? $rootScope.wallet.name + ' - ' : '') + $rootScope.wallet.id;
var href = 'mailto:' + email + '?'