further cleanup

This commit is contained in:
Zuzanna 2025-11-28 16:11:26 +01:00
parent 733f7ba539
commit 925c3ff8e9
2 changed files with 5 additions and 10 deletions

View File

@ -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;

View File

@ -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);
};