handle logout on messages page (#1503)

Go back to redirecting to splash on logout, and empty messages page too.
This commit is contained in:
Matthew Taylor 2017-09-05 14:31:10 -04:00 committed by GitHub
parent 432a6240aa
commit b77e278927
2 changed files with 7 additions and 1 deletions

View file

@ -138,7 +138,7 @@ var Navigation = React.createClass({
}, function (err) {
if (err) log.error(err);
this.closeLogin();
this.props.dispatch(sessionActions.refreshSession());
window.location = '/';
}.bind(this));
},
handleAccountNavClick: function (e) {

View file

@ -44,6 +44,12 @@ var Messages = React.createClass({
this.props.dispatch(
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));
}
}
},