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