diff --git a/src/pages/capture.tsx b/src/pages/capture.tsx index 63ec63c..e1a8e86 100644 --- a/src/pages/capture.tsx +++ b/src/pages/capture.tsx @@ -10,13 +10,13 @@ export { getServerSideProps } from "../web/search/anySearchPage"; const CapturePage: NextPage = (props) => { return ( - + diff --git a/src/web/search/CommonDisplay.tsx b/src/web/search/CommonDisplay.tsx index b18fffd..243e101 100644 --- a/src/web/search/CommonDisplay.tsx +++ b/src/web/search/CommonDisplay.tsx @@ -81,27 +81,28 @@ const CommonDisplay: React.FC = ({ if (queryIsEmpty) { const filterManually = (results: QuestionFragment[]) => { + let filteredResults = [...results]; if ( queryParameters.forecastingPlatforms && queryParameters.forecastingPlatforms.length > 0 ) { - results = results.filter((result) => + filteredResults = filteredResults.filter((result) => queryParameters.forecastingPlatforms.includes(result.platform.id) ); } if (queryParameters.starsThreshold === 4) { - results = results.filter( + filteredResults = filteredResults.filter( (result) => result.qualityIndicators.stars >= 4 ); } if (queryParameters.forecastsThreshold) { // TODO / FIXME / remove? } - return results; + return filteredResults; }; return filterManually(defaultResults); } else { - return queryResults.data?.result; + return queryResults.data?.result || []; } }, [queryResults.data, queryParameters]);