mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +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() {
|
getContentMetadata() {
|
||||||
return sql.getRow(`
|
return sql.getRow(`
|
||||||
SELECT
|
SELECT
|
||||||
|
@ -30,6 +30,8 @@ function createNoteRevision(note) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const contentMetadata = note.getContentMetadata();
|
||||||
|
|
||||||
const noteRevision = new NoteRevision({
|
const noteRevision = new NoteRevision({
|
||||||
noteId: note.noteId,
|
noteId: note.noteId,
|
||||||
// title and text should be decrypted now
|
// title and text should be decrypted now
|
||||||
@ -37,10 +39,14 @@ function createNoteRevision(note) {
|
|||||||
type: note.type,
|
type: note.type,
|
||||||
mime: note.mime,
|
mime: note.mime,
|
||||||
isProtected: false, // will be fixed in the protectNoteRevisions() call
|
isProtected: false, // will be fixed in the protectNoteRevisions() call
|
||||||
utcDateLastEdited: note.utcDateModified,
|
utcDateLastEdited: note.utcDateModified > contentMetadata.utcDateModified
|
||||||
|
? note.utcDateModified
|
||||||
|
: contentMetadata.utcDateModified,
|
||||||
utcDateCreated: dateUtils.utcNowDateTime(),
|
utcDateCreated: dateUtils.utcNowDateTime(),
|
||||||
utcDateModified: dateUtils.utcNowDateTime(),
|
utcDateModified: dateUtils.utcNowDateTime(),
|
||||||
dateLastEdited: note.dateModified,
|
dateLastEdited: note.dateModified > contentMetadata.dateModified
|
||||||
|
? note.dateModified
|
||||||
|
: contentMetadata.dateModified,
|
||||||
dateCreated: dateUtils.localNowDateTime()
|
dateCreated: dateUtils.localNowDateTime()
|
||||||
}).save();
|
}).save();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user