Skip to content

Commit

Permalink
Merge pull request #3045 from OpenNeuroOrg/3043-default-portal-search…
Browse files Browse the repository at this point in the history
…-params

fix(app): Apply default search parameters on any initial render
  • Loading branch information
nellh authored May 8, 2024
2 parents 231ec25 + cbc11d4 commit cd5c1e0
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions packages/openneuro-app/src/scripts/search/search-container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,12 @@ const SearchContainer: FC<SearchContainerProps> = ({ portalContent }) => {

const { searchParams, setSearchParams } = useContext(SearchParamsCtx)
const modality = portalContent?.modality || null
useEffect(() => {
setDefaultSearch(
modality,
searchParams,
setSearchParams,
new URLSearchParams(location.search),
)
}, [modality, searchParams.modality_selected, setSearchParams, location])
setDefaultSearch(
modality,
searchParams,
setSearchParams,
new URLSearchParams(location.search),
)

const { loading, data, fetchMore, refetch, variables, error } =
useSearchResults()
Expand Down

0 comments on commit cd5c1e0

Please sign in to comment.