mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-12-23 18:21:40 +00:00
Update to make OT socket io handle error better, use delay to avoid wrong reversion on client
This commit is contained in:
parent
73a8a6c32a
commit
a090008d4a
1 changed files with 9 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue