Skip to content

Commit dfc11b0

Browse files
committed
only initialize the default filters if no filters were given
1 parent 8af57e1 commit dfc11b0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

source/views/sis/course-search/results.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,16 @@ class CourseSearchResultsView extends React.Component<Props, State> {
7171

7272
state = {
7373
isSearchbarActive: false,
74-
filtersLoaded: false,
74+
filtersLoaded: Boolean(this.props.navigation.state.params.initialFilters),
7575
filters: this.props.navigation.state.params.initialFilters || [],
7676
typedQuery: this.props.navigation.state.params.initialQuery || '',
7777
searchQuery: this.props.navigation.state.params.initialQuery || '',
7878
}
7979

8080
componentDidMount() {
81-
this.resetFilters()
81+
if (!this.state.filters.length) {
82+
this.resetFilters()
83+
}
8284
}
8385

8486
handleSearchSubmit = () => {

0 commit comments

Comments
 (0)