mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 21:11:30 +08:00 
			
		
		
		
	fix note map with noteId = 'none'
This commit is contained in:
		
							parent
							
								
									a316ac5b35
								
							
						
					
					
						commit
						8a39699acd
					
				| @ -142,7 +142,6 @@ function getTreeMap(req) { | |||||||
|     // if the map root itself has ignore (journal typically) then there wouldn't be anything to display so
 |     // if the map root itself has ignore (journal typically) then there wouldn't be anything to display so
 | ||||||
|     // we'll just ignore it
 |     // we'll just ignore it
 | ||||||
|     const ignoreExcludeFromNoteMap = mapRootNote.hasLabel('excludeFromNoteMap'); |     const ignoreExcludeFromNoteMap = mapRootNote.hasLabel('excludeFromNoteMap'); | ||||||
|     const noteIds = new Set(); |  | ||||||
| 
 | 
 | ||||||
|     const notes = mapRootNote.getSubtreeNotes(false) |     const notes = mapRootNote.getSubtreeNotes(false) | ||||||
|         .filter(note => ignoreExcludeFromNoteMap || !note.hasLabel('excludeFromNoteMap')) |         .filter(note => ignoreExcludeFromNoteMap || !note.hasLabel('excludeFromNoteMap')) | ||||||
| @ -159,13 +158,14 @@ function getTreeMap(req) { | |||||||
| 
 | 
 | ||||||
|             return !note.getParentNotes().find(parentNote => parentNote.noteId === imageLinkRelation.noteId); |             return !note.getParentNotes().find(parentNote => parentNote.noteId === imageLinkRelation.noteId); | ||||||
|         }) |         }) | ||||||
|         .concat(...mapRootNote.getParentNotes()) |         .concat(...mapRootNote.getParentNotes().filter(note => note.noteId !== 'none')) | ||||||
|         .map(note => [ |         .map(note => [ | ||||||
|             note.noteId, |             note.noteId, | ||||||
|             note.getTitleOrProtected(), |             note.getTitleOrProtected(), | ||||||
|             note.type |             note.type | ||||||
|         ]); |         ]); | ||||||
| 
 | 
 | ||||||
|  |     const noteIds = new Set(); | ||||||
|     notes.forEach(([noteId]) => noteIds.add(noteId)); |     notes.forEach(([noteId]) => noteIds.add(noteId)); | ||||||
| 
 | 
 | ||||||
|     const links = []; |     const links = []; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 zadam
						zadam