mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
fix JSON saving bug
This commit is contained in:
parent
d2e2caed62
commit
120888b53e
@ -21,6 +21,14 @@ class Note extends Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setContent(content) {
|
||||||
|
this.content = content;
|
||||||
|
|
||||||
|
if (this.isJson()) {
|
||||||
|
this.jsonContent = JSON.parse(this.content);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
isJson() {
|
isJson() {
|
||||||
return this.mime === "application/json";
|
return this.mime === "application/json";
|
||||||
}
|
}
|
||||||
|
@ -198,7 +198,7 @@ async function updateNote(noteId, noteUpdates) {
|
|||||||
await saveNoteRevision(note);
|
await saveNoteRevision(note);
|
||||||
|
|
||||||
note.title = noteUpdates.title;
|
note.title = noteUpdates.title;
|
||||||
note.content = noteUpdates.content;
|
note.setContent(noteUpdates.content);
|
||||||
note.isProtected = noteUpdates.isProtected;
|
note.isProtected = noteUpdates.isProtected;
|
||||||
await note.save();
|
await note.save();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user