mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 13:39:01 +01:00 
			
		
		
		
	fix hidden notes appearing in note map, closes #2403
This commit is contained in:
		
							parent
							
								
									89c04e6b6b
								
							
						
					
					
						commit
						26bcfe5160
					
				@ -42,6 +42,11 @@ function getNeighbors(note, depth) {
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        const targetNote = relation.getTargetNote();
 | 
			
		||||
 | 
			
		||||
        if (targetNote.hasLabel('excludeFromNoteMap')) {
 | 
			
		||||
            continue;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        retNoteIds.push(targetNote.noteId);
 | 
			
		||||
 | 
			
		||||
        for (const noteId of getNeighbors(targetNote, depth - 1)) {
 | 
			
		||||
@ -56,6 +61,11 @@ function getNeighbors(note, depth) {
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        const sourceNote = relation.getNote();
 | 
			
		||||
 | 
			
		||||
        if (sourceNote.hasLabel('excludeFromNoteMap')) {
 | 
			
		||||
            continue;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        retNoteIds.push(sourceNote.noteId);
 | 
			
		||||
 | 
			
		||||
        for (const noteId of getNeighbors(sourceNote, depth - 1)) {
 | 
			
		||||
 | 
			
		||||
@ -44,6 +44,7 @@ function getHiddenRoot() {
 | 
			
		||||
        // isInheritable: false means that this notePath is automatically not preffered but at the same time
 | 
			
		||||
        // the flag is not inherited to the children
 | 
			
		||||
        hidden.addLabel('archived', "", false);
 | 
			
		||||
        hidden.addLabel('excludeFromNoteMap', "", true);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return hidden;
 | 
			
		||||
@ -206,6 +207,12 @@ function createMissingSpecialNotes() {
 | 
			
		||||
    getSinglesNoteRoot();
 | 
			
		||||
    getSinglesNoteRoot();
 | 
			
		||||
    getGlobalNoteMap();
 | 
			
		||||
 | 
			
		||||
    const hidden = getHiddenRoot();
 | 
			
		||||
 | 
			
		||||
    if (!hidden.hasOwnedLabel('excludeFromNoteMap')) {
 | 
			
		||||
        hidden.addLabel('excludeFromNoteMap', "", true);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
module.exports = {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user