From e02c92246491b36c082e2580a57bd0154fbb900f Mon Sep 17 00:00:00 2001 From: Claire Chabas Date: Fri, 10 Jan 2025 19:47:33 +0100 Subject: [PATCH] testing --- .../src/components/Search/SearchResults.tsx | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/packages/gitbook/src/components/Search/SearchResults.tsx b/packages/gitbook/src/components/Search/SearchResults.tsx index ccd1570d2..45e27e6ec 100644 --- a/packages/gitbook/src/components/Search/SearchResults.tsx +++ b/packages/gitbook/src/components/Search/SearchResults.tsx @@ -111,7 +111,7 @@ export const SearchResults = React.forwardRef(function SearchResults( cancelled = true; }; } else { - console.log('CLAIRE', {query, global, pointer, spaceId, revisionId, withAsk, trackEvent, getCtx}) + console.log('CLAIRE', window.location) setResultsState((prev) => ({ results: prev.results, fetching: true })); let cancelled = false; const timeout = setTimeout(async () => { @@ -150,15 +150,11 @@ export const SearchResults = React.forwardRef(function SearchResults( }, [query, global, pointer, spaceId, revisionId, withAsk, trackEvent, getCtx]); const results: ResultType[] = React.useMemo(() => { - if(!resultsState.fetching) { - if (!withAsk) { - return resultsState.results; - } - return withQuestionResult(resultsState.results, query); - } else { - return []; + if (!withAsk) { + return resultsState.results; } - }, [resultsState.results, resultsState.fetching, query, withAsk]); + return withQuestionResult(resultsState.results, query); + }, [resultsState.results, query, withAsk]); React.useEffect(() => { if (!query) {