Fix socket io doc event should setDoc when revision mismatch and no outstanding operation

This commit is contained in:
Wu Cheng-Han 2016-10-23 20:17:33 +08:00
parent 5ad7d61499
commit 3db1214ecf
1 changed files with 1 additions and 1 deletions

View File

@ -2651,7 +2651,7 @@ socket.on('doc', function (obj) {
obj = JSON.parse(obj);
var body = obj.str;
var bodyMismatch = editor.getValue() !== body;
var setDoc = !cmClient || (cmClient && cmClient.revision === -1) || obj.force;
var setDoc = !cmClient || (cmClient && (cmClient.revision === -1 || (cmClient.revision !== obj.revision && Object.keys(cmClient.state).length <= 0))) || obj.force;
saveInfo();
if (setDoc && bodyMismatch) {