fix: capture page
This commit is contained in:
parent
689edac83e
commit
db85d80ddb
|
@ -10,13 +10,13 @@ export { getServerSideProps } from "../web/search/anySearchPage";
|
|||
|
||||
const CapturePage: NextPage<Props> = (props) => {
|
||||
return (
|
||||
<Layout page={"capture"}>
|
||||
<Layout page="capture">
|
||||
<CommonDisplay
|
||||
{...props}
|
||||
hasSearchbar={true}
|
||||
hasCapture={true}
|
||||
hasAdvancedOptions={false}
|
||||
placeholder={"Get best title match..."}
|
||||
placeholder="Get best title match..."
|
||||
displaySeeMoreHint={false}
|
||||
displayQuestionsWrapper={displayQuestionsWrapperForCapture}
|
||||
/>
|
||||
|
|
|
@ -81,27 +81,28 @@ const CommonDisplay: React.FC<Props> = ({
|
|||
|
||||
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]);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user