Move OO history out of normal history module

pull/1/head
yflory 4 years ago
parent 4f147d4fd2
commit 20b23ee9d1

@ -54,29 +54,6 @@ define([
});
};
var cpIndex = 0;
var sortedCp;
if (config.onlyoffice) {
sortedCp = Object.keys(config.onlyoffice).map(Number).sort(function (a, b) {
return a-b;
});
}
var loadMoreOOHistory = function () {
if (!Array.isArray(sortedCp)) {
return void console.error("Wrong type");
}
var hashes = config.onlyoffice;
if (!sortedCp.length) {
// XXX no cp
}
var cp = {};
if (cpIndex < sortedCp.length) {
var idx = sortedCp[sortedCp.length - 1 - cpIndex];
cp = config.onlyoffice[idx];
}
config.onLocal(cp);
};
var allMessages = [];
var lastKnownHash;
var isComplete = false;
@ -357,10 +334,6 @@ define([
config.onOpen();
}
if (config.onlyoffice) {
return void loadMoreOOHistory();
}
// Load all the history messages into a new chainpad object
loadMoreHistory(config, common, function (err, newRt, isFull) {
History.readOnly = common.getMetadataMgr().getPrivateData().readOnly;

Loading…
Cancel
Save