Skip to content

Commit d445836

Browse files
committed
Correct stage count
Selecting other stages shouldn't change the stage count, but selecting subjects/topics should.
1 parent af99f43 commit d445836

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/app/components/pages/Concepts.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ export const Concepts = withRouter((props: RouteComponentProps) => {
8888

8989
const stageCounts = getFilteredStageOptions().reduce((acc, s) => ({
9090
...acc,
91-
[s.value]: shortcutAndFilter(listConceptsQuery?.data?.results, true)?.filter(c => c.audience?.some(a => a.stage?.includes(s.value))).length || 0
91+
[s.value]: listConceptsQuery?.data?.results?.filter(c => c.audience?.some(a => a.stage?.includes(s.value))
92+
&& (!filters.length || c.tags?.some(t => filters.includes(t))))?.length || 0
9293
}), {});
9394

9495
function doSearch(e?: FormEvent<HTMLFormElement>) {

0 commit comments

Comments
 (0)