@civicactions/cmsds-open-data-components 4.0.1-alpha.2 → 4.0.2-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -4540,10 +4540,6 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
4540
4540
  }
4541
4541
  const pageSize = defaultPageSize;
4542
4542
  (0, $hgUW1$useEffect)(()=>{
4543
- // Update browser URL with current search params
4544
- const params = buildSearchParams(true);
4545
- const url = new URL(window.location.href);
4546
- window.history.pushState({}, "", `${url.origin}${url.pathname}${params}`);
4547
4543
  const baseNumber = Number(totalItems) > 0 ? 1 : 0;
4548
4544
  const startingNumber = baseNumber + (Number(pageSize) * Number(page) - Number(pageSize));
4549
4545
  const endingNumber = Number(pageSize) * Number(page);
@@ -4569,12 +4565,15 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
4569
4565
  selectedFacets
4570
4566
  ]);
4571
4567
  (0, $hgUW1$useEffect)(()=>{
4572
- var params = buildSearchParams(true);
4573
- if (params !== location.search) setSearchParams(params);
4568
+ if (totalItems !== null && totalItems !== undefined && totalItems > 0) {
4569
+ var params = buildSearchParams(true);
4570
+ if (params !== location.search) setSearchParams(params);
4571
+ }
4574
4572
  }, [
4575
4573
  page,
4576
4574
  sort,
4577
- sortOrder
4575
+ sortOrder,
4576
+ totalItems
4578
4577
  ]);
4579
4578
  function resetFilters() {
4580
4579
  setFullText(defaultFulltext);