diff options
author | Wu Cheng-Han | 2016-10-23 20:17:33 +0800 |
---|---|---|
committer | Wu Cheng-Han | 2016-10-23 20:17:33 +0800 |
commit | 3db1214ecf22ad54cd0d4bb324c461df252d9a51 (patch) | |
tree | 056ec261d1ce3140f7669d9f1d6b489221944628 /public | |
parent | 5ad7d614991d1a1b6261bacce224b38f8cd34afc (diff) |
Fix socket io doc event should setDoc when revision mismatch and no outstanding operation
Diffstat (limited to '')
-rw-r--r-- | public/js/index.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/public/js/index.js b/public/js/index.js index 77ab089c..47919d37 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -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) { |