mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	fix calendar widget when hoisted into hidden subtree
This commit is contained in:
		| @@ -39,6 +39,8 @@ class NoteContext extends Component { | |||||||
|     async setNote(inputNotePath, triggerSwitchEvent = true) { |     async setNote(inputNotePath, triggerSwitchEvent = true) { | ||||||
|         const resolvedNotePath = await this.getResolvedNotePath(inputNotePath); |         const resolvedNotePath = await this.getResolvedNotePath(inputNotePath); | ||||||
|  |  | ||||||
|  |         console.log("EEEEEE", inputNotePath, resolvedNotePath); | ||||||
|  |  | ||||||
|         if (!resolvedNotePath) { |         if (!resolvedNotePath) { | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| @@ -67,14 +69,14 @@ class NoteContext extends Component { | |||||||
|             && this.notePath.startsWith("root/_hidden") |             && this.notePath.startsWith("root/_hidden") | ||||||
|             && !this.note.hasLabel("keepCurrentHoisting") |             && !this.note.hasLabel("keepCurrentHoisting") | ||||||
|         ) { |         ) { | ||||||
|             // hidden subtree displays only when hoisted so it doesn't make sense to keep root as hoisted note |             // hidden subtree displays only when hoisted, so it doesn't make sense to keep root as hoisted note | ||||||
|  |  | ||||||
|             let hoistedNoteId = '_hidden'; |             let hoistedNoteId = '_hidden'; | ||||||
|  |  | ||||||
|             if (this.note.isLaunchBarConfig()) { |             if (this.note.isLaunchBarConfig()) { | ||||||
|                 hoistedNoteId = '_lbRoot'; |                 hoistedNoteId = '_lbRoot'; | ||||||
|             } else if (this.note.isOptions()) { |             } else if (this.note.isOptions()) { | ||||||
|                 hoistedNoteId = 'options'; |                 hoistedNoteId = '_options'; | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             await this.setHoistedNoteId(hoistedNoteId); |             await this.setHoistedNoteId(hoistedNoteId); | ||||||
|   | |||||||
| @@ -54,8 +54,8 @@ async function checkNoteAccess(notePath, noteContext) { | |||||||
|         const requestedNote = await froca.getNote(treeService.getNoteIdFromNotePath(resolvedNotePath)); |         const requestedNote = await froca.getNote(treeService.getNoteIdFromNotePath(resolvedNotePath)); | ||||||
|         const hoistedNote = await froca.getNote(hoistedNoteId); |         const hoistedNote = await froca.getNote(hoistedNoteId); | ||||||
|  |  | ||||||
|         if (hoistedNote.hasAncestor('_hidden') |         if (!hoistedNote.hasAncestor('_hidden') | ||||||
|             || !await dialogService.confirm(`Requested note '${requestedNote.title}' is outside of hoisted note '${hoistedNote.title}' subtree and you must unhoist to access the note. Do you want to proceed with unhoisting?`)) { |             && !await dialogService.confirm(`Requested note '${requestedNote.title}' is outside of hoisted note '${hoistedNote.title}' subtree and you must unhoist to access the note. Do you want to proceed with unhoisting?`)) { | ||||||
|             return false; |             return false; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user