From 9b9b6bd2b7b8df92fe907915e4d80986492b7fd1 Mon Sep 17 00:00:00 2001
From: Reed Garmsen <rgarmsen2295@gmail.com>
Date: Fri, 19 Jun 2015 12:51:35 -0700
Subject: Made it so the team creator can no longer use the same email used at
 signup to send an invitation to

---
 web/react/components/signup_team_complete.jsx | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

(limited to 'web/react/components/signup_team_complete.jsx')

diff --git a/web/react/components/signup_team_complete.jsx b/web/react/components/signup_team_complete.jsx
index b038679e6..65f4c9e0a 100644
--- a/web/react/components/signup_team_complete.jsx
+++ b/web/react/components/signup_team_complete.jsx
@@ -312,7 +312,7 @@ EmailItem = React.createClass({
     getValue: function() {
         return this.refs.email.getDOMNode().value.trim()
     },
-    validate: function() {
+    validate: function(teamEmail) {
         var email = this.refs.email.getDOMNode().value.trim().toLowerCase();
 
         if (!email) {
@@ -324,6 +324,11 @@ EmailItem = React.createClass({
             this.setState(this.state);
             return false;
         }
+        else if (email === teamEmail) {
+            this.state.email_error = "Please use an a different email than the one used at signup";
+            this.setState(this.state);
+            return false;
+        }
         else {
             this.state.email_error = "";
             this.setState(this.state);
@@ -363,7 +368,7 @@ SendInivtesPage = React.createClass({
         var emails = [];
 
         for (var i = 0; i < this.props.state.invites.length; i++) {
-            if (!this.refs['email_' + i].validate()) {
+            if (!this.refs['email_' + i].validate(this.props.state.team.email)) {
                 valid = false;
             } else {
                 emails.push(this.refs['email_' + i].getValue());
-- 
cgit v1.2.3-1-g7c22

