mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	protected session in a component now works
This commit is contained in:
		| @@ -14,6 +14,7 @@ import noteDetailImage from "./note_detail_image.js"; | ||||
| import noteDetailSearch from "./note_detail_search.js"; | ||||
| import noteDetailRender from "./note_detail_render.js"; | ||||
| import noteDetailRelationMap from "./note_detail_relation_map.js"; | ||||
| import noteDetailProtectedSession from "./note_detail_protected_session.js"; | ||||
|  | ||||
| const $noteTabContentsContainer = $("#note-tab-container"); | ||||
|  | ||||
| @@ -24,7 +25,8 @@ const componentClasses = { | ||||
|     'image': noteDetailImage, | ||||
|     'search': noteDetailSearch, | ||||
|     'render': noteDetailRender, | ||||
|     'relation-map': noteDetailRelationMap | ||||
|     'relation-map': noteDetailRelationMap, | ||||
|     'protected-session': noteDetailProtectedSession | ||||
| }; | ||||
|  | ||||
| let tabIdCounter = 1; | ||||
| @@ -89,9 +91,19 @@ class NoteContext { | ||||
|         console.log(`Switched tab ${this.tabId} to ${this.noteId}`); | ||||
|     } | ||||
|  | ||||
|     getComponent(type) { | ||||
|         if (!type) { | ||||
|             type = this.note.type; | ||||
|     getComponent() { | ||||
|         let type = this.note.type; | ||||
|  | ||||
|         if (this.note.isProtected) { | ||||
|             if (protectedSessionHolder.isProtectedSessionAvailable()) { | ||||
|                 protectedSessionHolder.touchProtectedSession(); | ||||
|             } | ||||
|             else { | ||||
|                 type = 'protected-session'; | ||||
|  | ||||
|                 // user shouldn't be able to edit note title | ||||
|                 this.$noteTitle.prop("readonly", true); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         if (!(type in this.components)) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user