fix(linked-docs): add time for version 0 in history

This commit is contained in:
yflory 2026-07-28 16:48:10 +02:00
parent eaed6419b7
commit eab10bded1
2 changed files with 6 additions and 4 deletions

View File

@ -110,6 +110,7 @@ define([
const hashes = config.onlyoffice.hashes;
const mainRtChannel = config.onlyoffice.channel;
const ctime = config.onlyoffice.ctime;
const sortedCp = History.sortCpIndex(hashes);
@ -267,9 +268,8 @@ define([
const options = all.map((id, idx) => {
const cp = hashes[id] || {};
let time = '';;
if (cp?.time) {
time = ` - ${new Date(cp.time).toLocaleString()}`;
}
let t = cp?.time || (idx === 0 && id === 0 && ctime);
if (t) { time = ` - ${new Date(t).toLocaleString()}`; }
return {
tag: 'a',
attributes: {

View File

@ -3349,7 +3349,8 @@ Uncaught TypeError: Cannot read property 'calculatedType' of null
onlyoffice: {
hashes: content.hashes || {},
channel: content.channel,
lastHash: ooChannel.lastHash
lastHash: ooChannel.lastHash,
ctime: content.ctime
},
$toolbar: $('.cp-toolbar-container')
};
@ -3552,6 +3553,7 @@ Uncaught TypeError: Cannot read property 'calculatedType' of null
if (!content.channel && !Object.keys(content.hashes).length) {
content.channel = Hash.createChannelId();
content.ctime ||= +new Date();
APP.onLocal();
checkLinkedDocs();
}