From 1a34c49a9a662bfd1e97d732f14d554f30fb7b4d Mon Sep 17 00:00:00 2001 From: Mario Colque Date: Wed, 28 May 2014 18:16:46 -0300 Subject: [PATCH] email validation --- js/controllers/backup.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/controllers/backup.js b/js/controllers/backup.js index 7919879f6..df0bd5219 100644 --- a/js/controllers/backup.js +++ b/js/controllers/backup.js @@ -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 + '?'