mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 04:51:31 +08:00 
			
		
		
		
	don't show hidden notes in search results
This commit is contained in:
		
							parent
							
								
									1347d3fcc2
								
							
						
					
					
						commit
						0e01c19414
					
				| @ -88,6 +88,10 @@ function findResultsWithExpression(expression, searchContext) { | |||||||
|                 throw new Error(`Can't find note path for note ${JSON.stringify(note.getPojo())}`); |                 throw new Error(`Can't find note path for note ${JSON.stringify(note.getPojo())}`); | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|  |             if (notePathArray.includes("hidden")) { | ||||||
|  |                 return null; | ||||||
|  |             } | ||||||
|  | 
 | ||||||
|             return new SearchResult(notePathArray); |             return new SearchResult(notePathArray); | ||||||
|         }) |         }) | ||||||
|         .filter(note => !!note); |         .filter(note => !!note); | ||||||
| @ -176,8 +180,7 @@ function searchNotesForAutocomplete(query) { | |||||||
|         fuzzyAttributeSearch: true |         fuzzyAttributeSearch: true | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     const allSearchResults = findResultsWithQuery(query, searchContext) |     const allSearchResults = findResultsWithQuery(query, searchContext); | ||||||
|         .filter(res => !res.notePathArray.includes("hidden")); |  | ||||||
| 
 | 
 | ||||||
|     const trimmed = allSearchResults.slice(0, 200); |     const trimmed = allSearchResults.slice(0, 200); | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 zadam
						zadam