Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

changes for #524 side affect #610

Merged
merged 2 commits into from
Jul 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion client/src/pages/Search/Global.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export default function SearchGlobal({ keyword }) {
const dropdownRef = React.useRef(null);

const prevOrderBy = usePrevious(orderBy);
const prevKeyword = usePrevious(keyword);
const [prevCriteria, setPrevCriteria] = React.useState(null);
const cancelTokenSource = axios.CancelToken.source();
const usersPerPage = config.ITEMS_PER_PAGE;
Expand Down Expand Up @@ -208,7 +209,10 @@ export default function SearchGlobal({ keyword }) {
pageChanged = true;
}

if (_.isEqual(prevCriteria, criteria) && !pageChanged) {
if (_.isEqual(prevCriteria, criteria)
&& prevKeyword === keyword
&& prevOrderBy === orderBy
&& pageChanged === false) {
return;
} else {
setPrevCriteria(criteria);
Expand Down