From 0722494d41a7c8c9d7e375a0ca98589267be1644 Mon Sep 17 00:00:00 2001 From: azivner Date: Wed, 9 Jan 2019 23:36:17 +0100 Subject: [PATCH] fix saving JSON note with invalid JSON (previously in such a case content was not updated), fixes #307 --- src/entities/note.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/entities/note.js b/src/entities/note.js index 45cc40d89..4e61631ab 100644 --- a/src/entities/note.js +++ b/src/entities/note.js @@ -56,6 +56,9 @@ class Note extends Entity { setContent(content) { this.content = content; + // if parsing below is not successful then there's no jsonContent as opposed to still having the old unupdated ones + delete this.jsonContent; + try { this.jsonContent = JSON.parse(this.content); }