diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-07-13 12:07:50 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-07-13 12:07:50 -0400 |
commit | 6447af758cd27216d036e06b385770999dc213b1 (patch) | |
tree | 82c55cc2e441fa7eb51b57336e91897ee2571bcd /web/react/components/signup_user_complete.jsx | |
parent | 6cc8788193630b802375669c72fab02220cb692a (diff) | |
parent | 6a559febc292c272da24df440d80ae3b26a31d7f (diff) | |
download | chat-6447af758cd27216d036e06b385770999dc213b1.tar.gz chat-6447af758cd27216d036e06b385770999dc213b1.tar.bz2 chat-6447af758cd27216d036e06b385770999dc213b1.zip |
Merge pull request #163 from ralder/fix-and-refactor-browser-store
[webui] second bugfix for pr #150 and refactor BrowserStore
Diffstat (limited to 'web/react/components/signup_user_complete.jsx')
-rw-r--r-- | web/react/components/signup_user_complete.jsx | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/web/react/components/signup_user_complete.jsx b/web/react/components/signup_user_complete.jsx index fb96cc99f..fa0c26017 100644 --- a/web/react/components/signup_user_complete.jsx +++ b/web/react/components/signup_user_complete.jsx @@ -17,7 +17,7 @@ module.exports = React.createClass({ return; } - var username_error = utils.isValidUsername(this.state.user.username) + var username_error = utils.isValidUsername(this.state.user.username); if (username_error === "Cannot use a reserved word as a username.") { this.setState({name_error: "This username is reserved, please choose a new one.", email_error: "", password_error: "", server_error: ""}); return; @@ -53,7 +53,7 @@ module.exports = React.createClass({ UserStore.setLastEmail(this.state.user.email); UserStore.setCurrentUser(data); if (this.props.hash > 0) - BrowserStore.setGlobalItem(this.props.hash, JSON.stringify({wizard: "finished"})); + BrowserStore.setGlobalItem(this.props.hash, {wizard: "finished"}); window.location.href = '/channels/town-square'; }.bind(this), function(err) { @@ -73,12 +73,7 @@ module.exports = React.createClass({ ); }, getInitialState: function() { - var props = null; - try { - props = JSON.parse(BrowserStore.getGlobalItem(this.props.hash)); - } - catch(parse_error) { - } + var props = BrowserStore.getGlobalItem(this.props.hash); if (!props) { props = {}; @@ -91,7 +86,7 @@ module.exports = React.createClass({ props.original_email = this.props.email; } - return props ; + return props; }, render: function() { |