mirror of
https://github.com/zadam/trilium.git
synced 2025-02-24 06:54:44 +08:00
don't save zero byte buffers as note revisions
This commit is contained in:
parent
8855f29a49
commit
8a435a2149
1 changed files with 4 additions and 4 deletions
|
@ -23,17 +23,17 @@ function protectNoteRevisions(note) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Note} note
|
* @param {Note} note
|
||||||
* @return {NoteRevision}
|
* @return {NoteRevision|null}
|
||||||
*/
|
*/
|
||||||
function createNoteRevision(note) {
|
function createNoteRevision(note) {
|
||||||
if (note.hasLabel("disableVersioning")) {
|
if (note.hasLabel("disableVersioning")) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const content = note.getContent();
|
const content = note.getContent();
|
||||||
|
|
||||||
if (!content) {
|
if (!content || (Buffer.isBuffer(content) && content.byteLength === 0)) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const contentMetadata = note.getContentMetadata();
|
const contentMetadata = note.getContentMetadata();
|
||||||
|
|
Loading…
Reference in a new issue