mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 04:51:31 +08:00 
			
		
		
		
	update note title in link map when note is renamed
This commit is contained in:
		
							parent
							
								
									a89629b3de
								
							
						
					
					
						commit
						153de63f4d
					
				| @ -1,4 +1,5 @@ | |||||||
| import CollapsibleWidget from "../collapsible_widget.js"; | import CollapsibleWidget from "../collapsible_widget.js"; | ||||||
|  | import treeCache from "../../services/tree_cache.js"; | ||||||
| 
 | 
 | ||||||
| let linkMapContainerIdCtr = 1; | let linkMapContainerIdCtr = 1; | ||||||
| 
 | 
 | ||||||
| @ -89,5 +90,19 @@ export default class LinkMapWidget extends CollapsibleWidget { | |||||||
|         if (loadResults.getAttributes().find(attr => attr.type === 'relation' && (attr.noteId === this.noteId || attr.value === this.noteId))) { |         if (loadResults.getAttributes().find(attr => attr.type === 'relation' && (attr.noteId === this.noteId || attr.value === this.noteId))) { | ||||||
|             this.noteSwitched(); |             this.noteSwitched(); | ||||||
|         } |         } | ||||||
|  | 
 | ||||||
|  |         const changedNoteIds = loadResults.getNoteIds(); | ||||||
|  | 
 | ||||||
|  |         if (changedNoteIds.length > 0) { | ||||||
|  |             const $linkMapContainer = this.$body.find('.link-map-container'); | ||||||
|  | 
 | ||||||
|  |             for (const noteId of changedNoteIds) { | ||||||
|  |                 const note = treeCache.notes[noteId]; | ||||||
|  | 
 | ||||||
|  |                 if (note) { | ||||||
|  |                     $linkMapContainer.find(`a[data-note-path="${noteId}"]`).text(note.title); | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 zadam
						zadam