Skip to content

Commit

Permalink
don't show hidden notes in search results
Browse files Browse the repository at this point in the history
  • Loading branch information
zadam committed Jun 15, 2022
1 parent 1347d3f commit 0e01c19
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/services/search/services/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ function findResultsWithExpression(expression, searchContext) {
throw new Error(`Can't find note path for note ${JSON.stringify(note.getPojo())}`);
}

if (notePathArray.includes("hidden")) {
return null;
}

return new SearchResult(notePathArray);
})
.filter(note => !!note);
Expand Down Expand Up @@ -176,8 +180,7 @@ function searchNotesForAutocomplete(query) {
fuzzyAttributeSearch: true
});

const allSearchResults = findResultsWithQuery(query, searchContext)
.filter(res => !res.notePathArray.includes("hidden"));
const allSearchResults = findResultsWithQuery(query, searchContext);

const trimmed = allSearchResults.slice(0, 200);

Expand Down

0 comments on commit 0e01c19

Please sign in to comment.