mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
fix wrong dateLastEdited timestamp, closes #1254
This commit is contained in:
parent
c371873b7e
commit
d21cb78baa
@ -30,7 +30,13 @@ function createNoteRevision(note) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const contentMetadata = note.getContentMetadata();
|
const content = note.getContent();
|
||||||
|
|
||||||
|
if (!content) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const contentMetadata = note.getContentMetadata();console.log("contentMetadata", contentMetadata);
|
||||||
|
|
||||||
const noteRevision = new NoteRevision({
|
const noteRevision = new NoteRevision({
|
||||||
noteId: note.noteId,
|
noteId: note.noteId,
|
||||||
@ -50,7 +56,7 @@ function createNoteRevision(note) {
|
|||||||
dateCreated: dateUtils.localNowDateTime()
|
dateCreated: dateUtils.localNowDateTime()
|
||||||
}).save();
|
}).save();
|
||||||
|
|
||||||
noteRevision.setContent(note.getContent());
|
noteRevision.setContent(content);
|
||||||
|
|
||||||
return noteRevision;
|
return noteRevision;
|
||||||
}
|
}
|
||||||
|
@ -466,27 +466,7 @@ function saveNoteRevision(note) {
|
|||||||
const msSinceDateCreated = now.getTime() - dateUtils.parseDateTime(note.utcDateCreated).getTime();
|
const msSinceDateCreated = now.getTime() - dateUtils.parseDateTime(note.utcDateCreated).getTime();
|
||||||
|
|
||||||
if (!existingNoteRevisionId && msSinceDateCreated >= noteRevisionSnapshotTimeInterval * 1000) {
|
if (!existingNoteRevisionId && msSinceDateCreated >= noteRevisionSnapshotTimeInterval * 1000) {
|
||||||
const content = note.getContent();
|
noteRevisionService.createNoteRevision(note);
|
||||||
|
|
||||||
if (!content) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const noteRevision = new NoteRevision({
|
|
||||||
noteId: note.noteId,
|
|
||||||
// title and text should be decrypted now
|
|
||||||
title: note.title,
|
|
||||||
type: note.type,
|
|
||||||
mime: note.mime,
|
|
||||||
isProtected: false, // will be fixed in the protectNoteRevisions() call
|
|
||||||
utcDateLastEdited: note.utcDateModified,
|
|
||||||
utcDateCreated: dateUtils.utcNowDateTime(),
|
|
||||||
utcDateModified: dateUtils.utcNowDateTime(),
|
|
||||||
dateLastEdited: note.dateModified,
|
|
||||||
dateCreated: dateUtils.localNowDateTime()
|
|
||||||
}).save();
|
|
||||||
|
|
||||||
noteRevision.setContent(content);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user