diff --git a/www/common/onlyoffice/history.js b/www/common/onlyoffice/history.js index 4c9abb917..fef0a27c9 100644 --- a/www/common/onlyoffice/history.js +++ b/www/common/onlyoffice/history.js @@ -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: { diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index 4d0ea51d5..3ef513008 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -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(); }