Commit b77e2789 authored by Matthew Taylor's avatar Matthew Taylor Committed by GitHub

handle logout on messages page (#1503)

Go back to redirecting to splash on logout, and empty messages page too.
parent 432a6240
...@@ -138,7 +138,7 @@ var Navigation = React.createClass({ ...@@ -138,7 +138,7 @@ var Navigation = React.createClass({
}, function (err) { }, function (err) {
if (err) log.error(err); if (err) log.error(err);
this.closeLogin(); this.closeLogin();
this.props.dispatch(sessionActions.refreshSession()); window.location = '/';
}.bind(this)); }.bind(this));
}, },
handleAccountNavClick: function (e) { handleAccountNavClick: function (e) {
......
...@@ -44,6 +44,12 @@ var Messages = React.createClass({ ...@@ -44,6 +44,12 @@ var Messages = React.createClass({
this.props.dispatch( this.props.dispatch(
messageActions.getScratcherInvite(this.props.user.username, this.props.user.token) messageActions.getScratcherInvite(this.props.user.username, this.props.user.token)
); );
} else {
// user is logged out, empty messages
this.props.dispatch(messageActions.setMessages([]));
this.props.dispatch(messageActions.setAdminMessages([]));
this.props.dispatch(messageActions.setScratcherInvite({}));
this.props.dispatch(messageActions.setMessagesOffset(0));
} }
} }
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment