Skip to content
This repository has been archived by the owner on Apr 29, 2022. It is now read-only.

Commit

Permalink
Merge pull request #162 from leonardosfl/fix-dashboard-query
Browse files Browse the repository at this point in the history
Fix query being reset when selecting a filter
  • Loading branch information
harumhelmy authored Aug 8, 2020
2 parents 154fa57 + f42ca6a commit 61d83f5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/components/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,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) });
}
}, [apiQs]);
Expand Down Expand Up @@ -190,7 +190,7 @@ export default function Dashboard() {
onChange={e => {
const search = createPreprintQs(
{
text: covidTerms,
text: params.getAll('q'),
hasOthersRec: e.target.checked || null
},
location.search
Expand All @@ -217,7 +217,7 @@ export default function Dashboard() {
onChange={e => {
const search = createPreprintQs(
{
text: covidTerms,
text: params.getAll('q'),
hasPeerRec: e.target.checked || null
},
location.search
Expand All @@ -244,7 +244,7 @@ export default function Dashboard() {
onChange={e => {
const search = createPreprintQs(
{
text: covidTerms,
text: params.getAll('q'),
hasData: e.target.checked || null
},
location.search
Expand All @@ -271,7 +271,7 @@ export default function Dashboard() {
onChange={e => {
const search = createPreprintQs(
{
text: covidTerms,
text: params.getAll('q'),
hasCode: e.target.checked || null
},
location.search
Expand Down Expand Up @@ -299,7 +299,7 @@ export default function Dashboard() {
) => {
const search = createPreprintQs(
{
text: covidTerms,
text: params.getAll('q'),
sort: nextSortOption
},
location.search
Expand Down

0 comments on commit 61d83f5

Please sign in to comment.