mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
handle logout on messages page (#1503)
Go back to redirecting to splash on logout, and empty messages page too.
This commit is contained in:
parent
432a6240aa
commit
b77e278927
2 changed files with 7 additions and 1 deletions
|
@ -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) {
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue