mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 03:16:11 +01:00
chore(search): don't render note list if no results
This commit is contained in:
@@ -55,10 +55,16 @@ export default class SearchResultWidget extends NoteContextAwareWidget {
|
||||
}
|
||||
|
||||
async refreshWithNote(note: FNote) {
|
||||
const noResults = note.getChildNoteIds().length === 0 && !!note.searchResultsLoaded;
|
||||
|
||||
this.$content.empty();
|
||||
this.$noResults.toggle(note.getChildNoteIds().length === 0 && !!note.searchResultsLoaded);
|
||||
this.$noResults.toggle(noResults);
|
||||
this.$notExecutedYet.toggle(!note.searchResultsLoaded);
|
||||
|
||||
if (noResults || !note.searchResultsLoaded) {
|
||||
return;
|
||||
}
|
||||
|
||||
const noteListRenderer = new NoteListRenderer(this.$content, note, note.getChildNoteIds(), true);
|
||||
await noteListRenderer.renderList();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user