mirror of
https://github.com/zadam/trilium.git
synced 2025-06-05 17:38:47 +02:00
fix storing dateLastEdited timestamp in note revisions
This commit is contained in:
parent
032ffa8367
commit
b0bf88c487
@ -105,6 +105,7 @@ class Note extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
/** @returns {{contentLength, dateModified, utcDateModified}} */
|
||||
getContentMetadata() {
|
||||
return sql.getRow(`
|
||||
SELECT
|
||||
|
@ -30,6 +30,8 @@ function createNoteRevision(note) {
|
||||
return;
|
||||
}
|
||||
|
||||
const contentMetadata = note.getContentMetadata();
|
||||
|
||||
const noteRevision = new NoteRevision({
|
||||
noteId: note.noteId,
|
||||
// title and text should be decrypted now
|
||||
@ -37,10 +39,14 @@ function createNoteRevision(note) {
|
||||
type: note.type,
|
||||
mime: note.mime,
|
||||
isProtected: false, // will be fixed in the protectNoteRevisions() call
|
||||
utcDateLastEdited: note.utcDateModified,
|
||||
utcDateLastEdited: note.utcDateModified > contentMetadata.utcDateModified
|
||||
? note.utcDateModified
|
||||
: contentMetadata.utcDateModified,
|
||||
utcDateCreated: dateUtils.utcNowDateTime(),
|
||||
utcDateModified: dateUtils.utcNowDateTime(),
|
||||
dateLastEdited: note.dateModified,
|
||||
dateLastEdited: note.dateModified > contentMetadata.dateModified
|
||||
? note.dateModified
|
||||
: contentMetadata.dateModified,
|
||||
dateCreated: dateUtils.localNowDateTime()
|
||||
}).save();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user