mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 15:19:01 +02:00
feat(react/widgets): search results interfering with SQL results + bad note path style
This commit is contained in:
parent
735e91e636
commit
f2ce8b9f3c
@ -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() {
|
||||
<Alert type="info" className="search-no-results">{t("search_result.no_notes_found")}</Alert>
|
||||
)}
|
||||
|
||||
<div ref={searchContainerRef} className="search-results" />
|
||||
<div ref={searchContainerRef} className="search-result-widget-content" />
|
||||
</div>
|
||||
);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user