diff options
author | Yukai Huang | 2016-10-11 18:39:15 +0800 |
---|---|---|
committer | Yukai Huang | 2016-10-11 18:40:23 +0800 |
commit | 6e651c8108783d224c5f40d1bb8047a9ebbeff00 (patch) | |
tree | c7d501cc6ebb46399c397768b3f58ef05034c522 /lib/ot | |
parent | 21028c57735028574c769fb6650322eb3f0cb924 (diff) | |
parent | cd9f8fe36b707ff5a9f8f7be4d55145ddee97f3a (diff) |
Merge branch 'master' into webpack-frontend
Diffstat (limited to 'lib/ot')
-rwxr-xr-x | lib/ot/editor-socketio-server.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/ot/editor-socketio-server.js b/lib/ot/editor-socketio-server.js index 45ed5036..d062fa19 100755 --- a/lib/ot/editor-socketio-server.js +++ b/lib/ot/editor-socketio-server.js @@ -55,7 +55,15 @@ EditorSocketIOServer.prototype.addClient = function (socket) { if (typeof self.operationCallback === 'function') self.operationCallback(socket, operation); } catch (err) { - socket.disconnect(true); + setTimeout(function() { + var docOut = { + str: self.document, + revision: self.operations.length, + clients: self.users, + force: true + }; + socket.emit('doc', LZString.compressToUTF16(JSON.stringify(docOut))); + }, 100); } }); }); |