mirror of
https://github.com/zadam/trilium.git
synced 2025-11-08 04:42:28 +08:00
fix JSON saving bug
This commit is contained in:
parent
d2e2caed62
commit
120888b53e
2 changed files with 9 additions and 1 deletions
|
|
@ -21,6 +21,14 @@ class Note extends Entity {
|
|||
}
|
||||
}
|
||||
|
||||
setContent(content) {
|
||||
this.content = content;
|
||||
|
||||
if (this.isJson()) {
|
||||
this.jsonContent = JSON.parse(this.content);
|
||||
}
|
||||
}
|
||||
|
||||
isJson() {
|
||||
return this.mime === "application/json";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ async function updateNote(noteId, noteUpdates) {
|
|||
await saveNoteRevision(note);
|
||||
|
||||
note.title = noteUpdates.title;
|
||||
note.content = noteUpdates.content;
|
||||
note.setContent(noteUpdates.content);
|
||||
note.isProtected = noteUpdates.isProtected;
|
||||
await note.save();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue