mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	fix incorrect switch between protected/unprotected states causing content not being encrypted, fixes #510
This commit is contained in:
		
							
								
								
									
										2
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							| @@ -1,6 +1,6 @@ | ||||
| { | ||||
|   "name": "trilium", | ||||
|   "version": "0.31.3", | ||||
|   "version": "0.31.4", | ||||
|   "lockfileVersion": 1, | ||||
|   "requires": true, | ||||
|   "dependencies": { | ||||
|   | ||||
| @@ -186,8 +186,13 @@ async function protectNoteRecursively(note, protect) { | ||||
|  | ||||
| async function protectNote(note, protect) { | ||||
|     if (protect !== note.isProtected) { | ||||
|         const content = await note.getContent(); | ||||
|  | ||||
|         note.isProtected = protect; | ||||
|  | ||||
|         // this will force de/encryption | ||||
|         await note.setContent(content); | ||||
|  | ||||
|         await note.save(); | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user