diff --git a/webapp/src/hooks/customHooks/useBlockProducerState.js b/webapp/src/hooks/customHooks/useBlockProducerState.js index 67ee4104..18d97a31 100644 --- a/webapp/src/hooks/customHooks/useBlockProducerState.js +++ b/webapp/src/hooks/customHooks/useBlockProducerState.js @@ -55,12 +55,13 @@ const useBlockProducerState = () => { useEffect(() => { if (eosConfig.networkName === 'lacchain') return - let filter = CHIPS_FILTERS[CHIPS_NAMES.indexOf(filters.name)] + const {where,...filter} = CHIPS_FILTERS[CHIPS_NAMES.indexOf(filters.name)] setPagination((prev) => ({ ...prev, page: 1, - ...filter + ...filter, + where: {...where,owner:prev.where?.owner} })) }, [filters, setPagination]) diff --git a/webapp/src/hooks/customHooks/useSearchState.js b/webapp/src/hooks/customHooks/useSearchState.js index 7cc6d337..ae63df0e 100644 --- a/webapp/src/hooks/customHooks/useSearchState.js +++ b/webapp/src/hooks/customHooks/useSearchState.js @@ -7,7 +7,7 @@ const useSearchState = ({ query }) => { const [loadProducers, { loading = true, data: { producers, info } = {} }] = useLazyQuery(query) const location = useLocation() - const [pagination, setPagination] = useState({ page: 1, pages: 1, limit: 28 }) + const [pagination, setPagination] = useState({ page: 1, pages: 1, limit: 28, where: null }) const [filters, setFilters] = useState({ name: 'all', owner: '' }) const handleOnSearch = (newFilters) => { @@ -15,10 +15,9 @@ const useSearchState = ({ query }) => { setPagination((prev) => ({ ...prev, page: 1, - where: { owner: { _like: `%${newFilters.owner}%` }, ...pagination.where } + where: { ...pagination.where, owner: { _like: `%${newFilters.owner}%` } } })) } - setFilters(newFilters) }