Handle socketio errors properly

This commit is contained in:
anugu-chegg 2018-02-05 22:37:49 +05:30 committed by muxator
parent fb20c26c5f
commit 4265f4175e
2 changed files with 7 additions and 1 deletions

View File

@ -662,7 +662,8 @@ function getCollabClient(ace2editor, serverVars, initialUserInfo, options, _pad)
getMissedChanges: getMissedChanges,
callWhenNotCommitting: callWhenNotCommitting,
addHistoricalAuthors: tellAceAboutHistoricalAuthors,
setChannelState: setChannelState
setChannelState: setChannelState,
setStateIdle: setStateIdle
};
$(document).ready(setUpSocket);

View File

@ -221,6 +221,11 @@ function handshake()
pad.collabClient.setChannelState("DISCONNECTED", "reconnect_timeout");
});
socket.on('error', function(error) {
socket.realConnected = false;
pad.collabClient.setStateIdle();
});
var initalized = false;
socket.on('message', function(obj)