diff --git a/src/static/js/collab_client.js b/src/static/js/collab_client.js index 9fc03991..7cf98ae6 100644 --- a/src/static/js/collab_client.js +++ b/src/static/js/collab_client.js @@ -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); diff --git a/src/static/js/pad.js b/src/static/js/pad.js index 152a48d9..9abedd27 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -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)