mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-12 19:49:59 +05:00
fix(linked-docs): add time for version 0 in history
This commit is contained in:
parent
eaed6419b7
commit
eab10bded1
@ -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: {
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user