mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +01:00 
			
		
		
		
	fix error when saving unprotected notes
This commit is contained in:
		| @@ -1 +1 @@ | ||||
| module.exports = { build_date:"2017-11-16T19:29:52-05:00", build_revision: "c371ffb5974d8dccaec76c78dfa91dd54fcc624e" }; | ||||
| module.exports = { build_date:"2017-11-17T00:09:29-05:00", build_revision: "a6bf04f8d4dc92445e6b4decd7dbbaa2f3e3ebaa" }; | ||||
|   | ||||
| @@ -166,7 +166,7 @@ async function updateNote(noteId, newNote, ctx) { | ||||
|             await sync_table.addNoteHistorySync(newNoteHistoryId); | ||||
|         } | ||||
|  | ||||
|         await protectNoteHistory(noteId, ctx.getDataKey(), newNote.detail.is_protected); | ||||
|         await protectNoteHistory(noteId, ctx.getDataKeyOrNull(), newNote.detail.is_protected); | ||||
|  | ||||
|         await addNoteAudits(origNoteDetail, newNote.detail, ctx.browserId); | ||||
|  | ||||
|   | ||||
| @@ -17,9 +17,18 @@ module.exports = function(req) { | ||||
|         return protected_session.getDataKey(req); | ||||
|     } | ||||
|  | ||||
|     function getDataKeyOrNull() { | ||||
|         if (!isProtectedSessionAvailable()) { | ||||
|             return null; | ||||
|         } | ||||
|  | ||||
|         return protected_session.getDataKey(req); | ||||
|     } | ||||
|  | ||||
|     return { | ||||
|         browserId, | ||||
|         isProtectedSessionAvailable, | ||||
|         getDataKey | ||||
|         getDataKey, | ||||
|         getDataKeyOrNull | ||||
|     }; | ||||
| }; | ||||
		Reference in New Issue
	
	Block a user