diff --git a/webapp/channels/src/actions/websocket_actions.jsx b/webapp/channels/src/actions/websocket_actions.jsx index 87c3f46718..59677a8e8f 100644 --- a/webapp/channels/src/actions/websocket_actions.jsx +++ b/webapp/channels/src/actions/websocket_actions.jsx @@ -333,10 +333,12 @@ export async function reconnect(socketId) { }); if (state.websocket.lastDisconnectAt) { + console.log('lastConnectAt', state.websocket.lastConnectAt); + console.log('lastDisconnectAt', state.websocket.lastDisconnectAt); // eslint-disable-next-line no-console - console.log('[websocket_actions] lastDisconnectAt: ', state.websocket.lastDisconnectAt); dispatch(checkForModifiedUsers(true)); dispatch(TeamActions.getMyKSuites()); + console.log('[websocket_actions] lastDisconnectAt: ', state.websocket.lastDisconnectAt); } dispatch(resetWsErrorCount()); diff --git a/webapp/channels/src/packages/mattermost-redux/src/reducers/websocket.ts b/webapp/channels/src/packages/mattermost-redux/src/reducers/websocket.ts index 33786531bd..d0892e1ba8 100644 --- a/webapp/channels/src/packages/mattermost-redux/src/reducers/websocket.ts +++ b/webapp/channels/src/packages/mattermost-redux/src/reducers/websocket.ts @@ -25,15 +25,12 @@ export default function reducer(state = getInitialState(), action: AnyAction) { return { ...state, connected: false, - lastDisconnectAt: action.timestamp, + lastDisconnectAt: state.lastDisconnectAt || action.timestamp, }; } if (action.type === UserTypes.LOGOUT_SUCCESS) { - return getInitialState(); - } - - if (action.type === UserTypes.LOGOUT_SUCCESS) { + console.log('RESET WS STATE'); return getInitialState(); }