Skip to content

Commit

Permalink
Add missed debounce application
Browse files Browse the repository at this point in the history
  • Loading branch information
gdalcengio committed Jun 10, 2024
1 parent 1c30c72 commit edc9d09
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/selectRangeUsePlanPage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,12 @@ const SelectRangeUsePlanPage = ({ match, history }) => {
const zoneUsers = references.USERS;

const { data, error, revalidate, isValidating } = useSWR(
`${API.SEARCH_AGREEMENTS}?page=${page}&selectedZones=${searchSelectedZones}&limit=${limit}&orderBy=${orderBy}&order=${order}&filterString=${JSON.stringify(filters)}`,
`${API.SEARCH_AGREEMENTS}?page=${debouncedPage}&selectedZones=${debouncedZones}&limit=${debouncedLimit}&orderBy=${debouncedOrderBy}&order=${debouncedOrder}&filterString=${JSON.stringify(debouncedFilters)}`,
(key) => axios.get(key, getAuthHeaderConfig()).then((res) => res.data),
{
onLoadingSlow: () =>
setToastId(warningToast('Agreements are taking a while to load', -1)),
onLoadingSlow: () => {
setToastId(warningToast('Agreements are taking a while to load', -1));
},
onError: () => {
if (references?.ZONES?.length > 0)
errorToast('Could not load agreements');
Expand Down

0 comments on commit edc9d09

Please sign in to comment.