mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +01:00 
			
		
		
		
	fix JSON saving bug
This commit is contained in:
		| @@ -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(); | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user