mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +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", |   "name": "trilium", | ||||||
|   "version": "0.31.3", |   "version": "0.31.4", | ||||||
|   "lockfileVersion": 1, |   "lockfileVersion": 1, | ||||||
|   "requires": true, |   "requires": true, | ||||||
|   "dependencies": { |   "dependencies": { | ||||||
|   | |||||||
| @@ -186,8 +186,13 @@ async function protectNoteRecursively(note, protect) { | |||||||
|  |  | ||||||
| async function protectNote(note, protect) { | async function protectNote(note, protect) { | ||||||
|     if (protect !== note.isProtected) { |     if (protect !== note.isProtected) { | ||||||
|  |         const content = await note.getContent(); | ||||||
|  |  | ||||||
|         note.isProtected = protect; |         note.isProtected = protect; | ||||||
|  |  | ||||||
|  |         // this will force de/encryption | ||||||
|  |         await note.setContent(content); | ||||||
|  |  | ||||||
|         await note.save(); |         await note.save(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user