Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion dist/js/job-search.min.js

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions src/js/react/apps/job-search/containers/ResultsContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@ const ResultsContainer = () => {
const scrollTarget = createRef<HTMLDivElement>();
const { query, promoted, handleResults } = useResultsQuery(urlParams);

// Scroll to results when they change.
const choices = Boolean(Object.keys(urlParams).length);
useScrollToResults(scrollTarget, choices);

const { data, error, isLoading, isValidating } = useIndexQuery({
keepPreviousData: true,
query,
multi: promoted
});

// Scroll to results when they change.
const choices = Boolean(Object.keys(urlParams).length);
const shouldScrollOnRender = Boolean(choices && !isLoading && !isValidating);
useScrollToResults(scrollTarget, shouldScrollOnRender);

const updatePage = (e: SyntheticEvent<HTMLButtonElement>, index: number) => {
e.preventDefault();
setPage(index.toString());
Expand Down
Loading