mirror of
https://github.com/wassname/talk.git
synced 2026-07-06 05:17:19 +08:00
Reset websocket after successful login
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user