Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit 01f6368

Browse files
committed
chore(search): don't render note list if no results
1 parent 5b99c8f commit 01f6368

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

apps/client/src/widgets/search_result.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,16 @@ export default class SearchResultWidget extends NoteContextAwareWidget {
5555
}
5656

5757
async refreshWithNote(note: FNote) {
58+
const noResults = note.getChildNoteIds().length === 0 && !!note.searchResultsLoaded;
59+
5860
this.$content.empty();
59-
this.$noResults.toggle(note.getChildNoteIds().length === 0 && !!note.searchResultsLoaded);
61+
this.$noResults.toggle(noResults);
6062
this.$notExecutedYet.toggle(!note.searchResultsLoaded);
6163

64+
if (noResults || !note.searchResultsLoaded) {
65+
return;
66+
}
67+
6268
const noteListRenderer = new NoteListRenderer(this.$content, note, note.getChildNoteIds(), true);
6369
await noteListRenderer.renderList();
6470
}

0 commit comments

Comments
 (0)