Fix style and race condition for history mode

This commit is contained in:
yflory
2017-09-21 18:00:11 +02:00
parent 95302366d1
commit dfdeb7b113
4 changed files with 23 additions and 11 deletions

View File

@@ -21,6 +21,15 @@ define([
var createRealtime = function () {
return ChainPad.create({
userName: 'history',
validateContent: function (content) {
try {
JSON.parse(content);
return true;
} catch (e) {
console.log('Failed to parse, rejecting patch');
return false;
}
},
initialState: '',
transformFunction: JsonOT.validate,
logLevel: 0,
@@ -69,9 +78,9 @@ define([
config.onLocal();
config.onRemote();
};
var onReady = function () {
config.setHistory(true);
};
config.setHistory(true);
var onReady = function () { };
var Messages = common.Messages;
var Cryptpad = common.getCryptpadCommon();