diff --git a/src/components/dashboard.js b/src/components/dashboard.js index 44c3fdf..990d5ff 100644 --- a/src/components/dashboard.js +++ b/src/components/dashboard.js @@ -59,7 +59,7 @@ export default function Dashboard() { const params = new URLSearchParams(location.search); useEffect(() => { - if (location.search === "") { + if (!params.get('q')) { history.replace({ search: createPreprintQs({ text: covidTerms }, location.search), state: location.state }); } }, [apiQs]); @@ -260,7 +260,7 @@ export default function Dashboard() { onChange={e => { const search = createPreprintQs( { - text: covidTerms, + text: params.getAll('q'), hasOthersRec: e.target.checked || null }, location.search @@ -287,7 +287,7 @@ export default function Dashboard() { onChange={e => { const search = createPreprintQs( { - text: covidTerms, + text: params.getAll('q'), hasPeerRec: e.target.checked || null }, location.search @@ -314,7 +314,7 @@ export default function Dashboard() { onChange={e => { const search = createPreprintQs( { - text: covidTerms, + text: params.getAll('q'), hasData: e.target.checked || null }, location.search @@ -341,7 +341,7 @@ export default function Dashboard() { onChange={e => { const search = createPreprintQs( { - text: covidTerms, + text: params.getAll('q'), hasCode: e.target.checked || null }, location.search @@ -369,7 +369,7 @@ export default function Dashboard() { ) => { const search = createPreprintQs( { - text: covidTerms, + text: params.getAll('q'), sort: nextSortOption }, location.search