mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +01:00 
			
		
		
		
	non null note title and content in the DB schema, allow saving non-valid JSON notes, children overview style changes
This commit is contained in:
		| @@ -17,17 +17,16 @@ class Note extends Entity { | ||||
|             protected_session.decryptNote(this); | ||||
|         } | ||||
|  | ||||
|         if (this.isJson()) { | ||||
|             this.jsonContent = JSON.parse(this.content); | ||||
|         } | ||||
|         this.setContent(this.content); | ||||
|     } | ||||
|  | ||||
|     setContent(content) { | ||||
|         this.content = content; | ||||
|  | ||||
|         if (this.isJson()) { | ||||
|         try { | ||||
|             this.jsonContent = JSON.parse(this.content); | ||||
|         } | ||||
|         catch(e) {} | ||||
|     } | ||||
|  | ||||
|     isJson() { | ||||
| @@ -142,7 +141,7 @@ class Note extends Entity { | ||||
|     beforeSaving() { | ||||
|         super.beforeSaving(); | ||||
|  | ||||
|         if (this.isJson()) { | ||||
|         if (this.isJson() && this.jsonContent) { | ||||
|             this.content = JSON.stringify(this.jsonContent, null, '\t'); | ||||
|         } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user