mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
further cleanup
This commit is contained in:
parent
733f7ba539
commit
925c3ff8e9
@ -38,9 +38,7 @@ define([
|
||||
var hashes = config.onlyoffice.hashes;
|
||||
var id;
|
||||
|
||||
var sortedCp = Object.keys(hashes).map(Number).sort(function (a, b) {
|
||||
return hashes[a].index - hashes[b].index;
|
||||
});
|
||||
var sortedCp = Object.keys(hashes).map(Number);
|
||||
|
||||
var getId = function () {
|
||||
var cps = sortedCp.length;
|
||||
@ -71,7 +69,7 @@ define([
|
||||
return version + '.0';
|
||||
}
|
||||
|
||||
if (typeof(position) === "undefined") {
|
||||
if (typeof(position) === "undefined" || position === -1) {
|
||||
position = ooMessages[id]?.length || 0;
|
||||
} else if (position === ooMessages[id]?.length && hashes[version + 1]) {
|
||||
position = 0;
|
||||
|
||||
@ -593,11 +593,9 @@ define([
|
||||
blob.name = title || (metadataMgr.getMetadataLazy().title || file.doc) + '.' + file.type;
|
||||
var data = {
|
||||
hash: (APP.history || APP.template) ? ooChannel.historyLastHash : ooChannel.lastHash,
|
||||
index: APP.revert ? ooChannel.currentIndex : ooChannel.cpIndex
|
||||
index: (APP.history || APP.template) ? ooChannel.currentIndex : ooChannel.cpIndex
|
||||
};
|
||||
if (APP.revert) {
|
||||
APP.revert = false;
|
||||
}
|
||||
|
||||
fixSheets();
|
||||
|
||||
if (!isLockedModal.modal) {
|
||||
@ -3128,11 +3126,10 @@ Uncaught TypeError: Cannot read property 'calculatedType' of null
|
||||
if (!privateData.ooVersionHash) {
|
||||
(function () {
|
||||
/* add a history button */
|
||||
var commit = function (revert) {
|
||||
var commit = function () {
|
||||
// Wait for the checkpoint to be uploaded before leaving history mode
|
||||
// (race condition). We use "stopHistory" to remove the history
|
||||
// flag only when the checkpoint is ready.
|
||||
APP.revert = revert ? true : false;
|
||||
APP.stopHistory = true;
|
||||
makeCheckpoint(true);
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user