diff --git a/js/actions/user_actions.js b/js/actions/user_actions.js index b1a006bc..1ea0c560 100644 --- a/js/actions/user_actions.js +++ b/js/actions/user_actions.js @@ -23,7 +23,7 @@ class UserActions { }); } logoutCurrentUser() { - UserFetcher.logout() + return UserFetcher.logout() .then(() => { this.actions.deleteCurrentUser(); }) diff --git a/js/components/ascribe_forms/form.js b/js/components/ascribe_forms/form.js index 87f26cb3..ecbd17de 100644 --- a/js/components/ascribe_forms/form.js +++ b/js/components/ascribe_forms/form.js @@ -80,7 +80,6 @@ let Form = React.createClass({ this.setState({edited: false, submitted: false}); }, handleError(err){ - console.log(err); if (err.json) { for (var input in err.json.errors){ if (this.refs && this.refs[input] && this.refs[input].state) { diff --git a/js/components/logout_container.js b/js/components/logout_container.js index 713cac7c..096fa490 100644 --- a/js/components/logout_container.js +++ b/js/components/logout_container.js @@ -3,7 +3,6 @@ import React from 'react'; import Router from 'react-router'; -let Link = Router.Link; import UserActions from '../actions/user_actions'; import Alt from '../alt'; @@ -15,11 +14,16 @@ let LogoutContainer = React.createClass({ mixins: [Router.Navigation, Router.State], componentDidMount() { - UserActions.logoutCurrentUser(); - Alt.flush(); - // kill intercom (with fire) - window.Intercom('shutdown'); - this.transitionTo(baseUrl); + UserActions.logoutCurrentUser() + .then(() => { + Alt.flush(); + // kill intercom (with fire) + window.Intercom('shutdown'); + this.transitionTo(baseUrl); + }) + .catch((err) => { + console.logGlobal(err); + }); }, render() {