From 2082ee5bdc69d6331db64af64ff686b99ddddd55 Mon Sep 17 00:00:00 2001
From: Reed Garmsen <rgarmsen2295@gmail.com>
Date: Thu, 18 Jun 2015 13:37:39 -0700
Subject: Added a util function that checks that local/session storage is
 enabled.  Also added tests using this function to report an error to the user
 if it is not enabled

---
 web/react/components/login.jsx | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

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

diff --git a/web/react/components/login.jsx b/web/react/components/login.jsx
index 65f1da1f8..85df5f797 100644
--- a/web/react/components/login.jsx
+++ b/web/react/components/login.jsx
@@ -21,6 +21,12 @@ var FindTeamDomain = React.createClass({
             return;
         }
 
+        if (!utils.isLocalStorageSupported()) {
+            state.server_error = "This service requires local storage to be enabled. Please enable it or exit private browsing.";
+            this.setState(state);
+            return;
+        }
+
         state.server_error = "";
         this.setState(state);
 
@@ -94,7 +100,7 @@ module.exports = React.createClass({
             return;
         }
 
-       var email = this.refs.email.getDOMNode().value.trim();
+        var email = this.refs.email.getDOMNode().value.trim();
         if (!email) {
             state.server_error = "An email is required"
             this.setState(state);
@@ -108,6 +114,12 @@ module.exports = React.createClass({
             return;
         }
 
+        if (!utils.isLocalStorageSupported()) {
+            state.server_error = "This service requires local storage to be enabled. Please enable it or exit private browsing.";
+            this.setState(state);
+            return;
+        }
+
         state.server_error = "";
         this.setState(state);
 
-- 
cgit v1.2.3-1-g7c22

