From f2ce8b9f3c0f37a87f50ca26c7246c7e46358d94 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 29 Aug 2025 16:28:49 +0300 Subject: [PATCH] feat(react/widgets): search results interfering with SQL results + bad note path style --- apps/client/src/widgets/search_result.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/client/src/widgets/search_result.tsx b/apps/client/src/widgets/search_result.tsx index 3392fbc69..88ca424fa 100644 --- a/apps/client/src/widgets/search_result.tsx +++ b/apps/client/src/widgets/search_result.tsx @@ -5,7 +5,7 @@ import { useNoteContext, useNoteProperty, useTriliumEvent } from "./react/hooks" import "./search_result.css"; import NoteListRenderer from "../services/note_list_renderer"; -enum SearchResultState { +enum SearchResultState { NO_RESULTS, NOT_EXECUTED, GOT_RESULTS @@ -19,7 +19,9 @@ export default function SearchResult() { function refresh() { searchContainerRef.current?.replaceChildren(); - if (!note?.searchResultsLoaded) { + if (note?.type !== "search") { + setState(undefined); + } else if (!note?.searchResultsLoaded) { setState(SearchResultState.NOT_EXECUTED); } else if (note.getChildNoteIds().length === 0) { setState(SearchResultState.NO_RESULTS); @@ -57,7 +59,7 @@ export default function SearchResult() { {t("search_result.no_notes_found")} )} -
+
); } \ No newline at end of file