File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import debounce from "lodash/debounce";
4
4
import {
5
5
arrayFromPossibleCsv ,
6
6
EXAM_BOARD ,
7
+ EXAM_BOARD_NULL_OPTIONS ,
7
8
getFilteredExamBoardOptions ,
8
9
isAda ,
9
10
isLoggedIn ,
@@ -15,6 +16,7 @@ import {
15
16
SEARCH_RESULTS_PER_PAGE ,
16
17
siteSpecific ,
17
18
STAGE ,
19
+ STAGE_NULL_OPTIONS ,
18
20
TAG_ID ,
19
21
tags ,
20
22
toSimpleCSV ,
@@ -119,12 +121,14 @@ export const QuestionFinder = withRouter(({location}: RouteComponentProps) => {
119
121
const filtersHaveNotBeenSpecifiedByQueryParams = FILTER_PARAMS . every ( p => ! params [ p ] ) ;
120
122
if ( filtersHaveNotBeenSpecifiedByQueryParams ) {
121
123
const accountStages = user . registeredContexts ?. map ( c => c . stage ) . filter ( s => s ) as STAGE [ ] ;
122
- if ( isPhy || accountStages . length === 1 ) { // Ada only want to apply stages filter if there is only one
124
+ const allStagesSelected = accountStages ?. some ( stage => STAGE_NULL_OPTIONS . includes ( stage ) ) ;
125
+ if ( ! allStagesSelected && ( isPhy || accountStages . length === 1 ) ) { // Ada only want to apply stages filter if there is only one
123
126
setSearchStages ( accountStages ) ;
124
127
setPopulatedFromAccountSettings ( true ) ;
125
128
}
126
129
const examBoardStages = user . registeredContexts ?. map ( c => c . examBoard ) . filter ( e => e ) as EXAM_BOARD [ ] ;
127
- if ( isAda && examBoardStages . length === 1 ) { // Phy does not have exam boards
130
+ const allExamBoardsSelected = examBoardStages ?. some ( examBoard => EXAM_BOARD_NULL_OPTIONS . includes ( examBoard ) ) ;
131
+ if ( isAda && ! allExamBoardsSelected && examBoardStages . length === 1 ) { // Phy does not have exam boards
128
132
setSearchExamBoards ( examBoardStages ) ;
129
133
setPopulatedFromAccountSettings ( true ) ;
130
134
}
You can’t perform that action at this time.
0 commit comments