mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 05:28:59 +01:00 
			
		
		
		
	fix creating note directly as protected
This commit is contained in:
		
							parent
							
								
									b51ac112a2
								
							
						
					
					
						commit
						4b41eddf44
					
				@ -95,7 +95,8 @@ async function createNewNote(parentNoteId, noteData) {
 | 
			
		||||
 | 
			
		||||
    note.noteContent = await new NoteContent({
 | 
			
		||||
        noteId: note.noteId,
 | 
			
		||||
        content: noteData.content
 | 
			
		||||
        content: noteData.content,
 | 
			
		||||
        isProtected: noteData.isProtected
 | 
			
		||||
    }).save();
 | 
			
		||||
 | 
			
		||||
    const branch = await new Branch({
 | 
			
		||||
 | 
			
		||||
@ -86,12 +86,17 @@ function decryptNoteRevision(hist) {
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (hist.title) {
 | 
			
		||||
        hist.title = dataEncryptionService.decryptString(dataKey, hist.title);
 | 
			
		||||
    }
 | 
			
		||||
    try {
 | 
			
		||||
        if (hist.title) {
 | 
			
		||||
            hist.title = dataEncryptionService.decryptString(dataKey, hist.title);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    if (hist.content) {
 | 
			
		||||
        hist.content = dataEncryptionService.decryptString(dataKey, hist.content);
 | 
			
		||||
        if (hist.content) {
 | 
			
		||||
            hist.content = dataEncryptionService.decryptString(dataKey, hist.content);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    catch (e) {
 | 
			
		||||
        throw new Error(`Decryption failed for note ${hist.noteId}: ` + e.message + " " + e.stack);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user