chore(search): don't render note list if no results

This commit is contained in:
Elian Doran 2025-05-29 17:41:02 +03:00
parent 5b99c8f595
commit 01f6368f95
No known key found for this signature in database

View File

@ -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();
}