Reset websocket after successful login

This commit is contained in:
Chi Vinh Le
2017-06-09 17:26:42 +07:00
parent 140f980c14
commit c7ca3c5e4a
+3 -5
View File
@@ -119,11 +119,6 @@ export const handleAuthToken = (token) => (dispatch) => {
Storage.setItem('exp', jwtDecode(token).exp);
Storage.setItem('token', token);
alert('handled the auth token!');
// Reset the websocket.
resetWebsocket();
dispatch({type: 'HANDLE_AUTH_TOKEN'});
};
@@ -318,6 +313,9 @@ export const checkLogin = () => (dispatch) => {
dispatch(checkLoginSuccess(result.user));
// Reset the websocket.
resetWebsocket();
// Display create username dialog if necessary.
if (result.user.canEditName && result.user.status !== 'BANNED') {
dispatch(showCreateUsernameDialog());