mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	fix setting window title when renaming notes
This commit is contained in:
		| @@ -129,12 +129,7 @@ export default class TabManager extends Component { | |||||||
|             window.history.pushState(null, "", url); |             window.history.pushState(null, "", url); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         const titleFragments = [ |         this.updateDocumentTitle(activeNoteContext); | ||||||
|             // it helps navigating in history if note title is included in the title |  | ||||||
|             activeNoteContext.note?.title, |  | ||||||
|             "Trilium Notes" |  | ||||||
|         ].filter(Boolean); |  | ||||||
|         document.title = titleFragments.join(" - "); |  | ||||||
|  |  | ||||||
|         this.triggerEvent('activeNoteChanged'); // trigger this even in on popstate event |         this.triggerEvent('activeNoteChanged'); // trigger this even in on popstate event | ||||||
|     } |     } | ||||||
| @@ -453,4 +448,22 @@ export default class TabManager extends Component { | |||||||
|     hoistedNoteChangedEvent() { |     hoistedNoteChangedEvent() { | ||||||
|         this.tabsUpdate.scheduleUpdate(); |         this.tabsUpdate.scheduleUpdate(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     updateDocumentTitle(activeNoteContext) { | ||||||
|  |         const titleFragments = [ | ||||||
|  |             // it helps navigating in history if note title is included in the title | ||||||
|  |             activeNoteContext.note?.title, | ||||||
|  |             "Trilium Notes" | ||||||
|  |         ].filter(Boolean); | ||||||
|  |  | ||||||
|  |         document.title = titleFragments.join(" - "); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     entitiesReloadedEvent({loadResults}) { | ||||||
|  |         const activeContext = this.getActiveContext(); | ||||||
|  |  | ||||||
|  |         if (activeContext && loadResults.isNoteReloaded(activeContext.noteId)) { | ||||||
|  |             this.updateDocumentTitle(activeContext); | ||||||
|  |         } | ||||||
|  |     } | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user