@civicactions/cmsds-open-data-components 4.0.6-oe → 4.0.7-oe
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 +21 -3
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -369,9 +369,15 @@ const $10bc3aae21fc1572$var$DatasetListSubmenu = ({ rootUrl: rootUrl, enablePagi
|
|
|
369
369
|
})}`);
|
|
370
370
|
}
|
|
371
371
|
});
|
|
372
|
+
// Sync totalItems state with API response data
|
|
373
|
+
// Moved to useEffect to prevent state updates during render (which can cause infinite loops)
|
|
374
|
+
(0, $hgUW1$useEffect)(()=>{
|
|
375
|
+
if (data?.data?.total !== undefined && data.data.total !== totalItems) setTotalItems(data.data.total);
|
|
376
|
+
}, [
|
|
377
|
+
data?.data?.total
|
|
378
|
+
]);
|
|
372
379
|
let submenuItemsCount = 0;
|
|
373
380
|
if (data) {
|
|
374
|
-
if (data.data.total && totalItems !== data.data.total) setTotalItems(data.data.total);
|
|
375
381
|
let resultsCount = Object.keys(data.data.results).length;
|
|
376
382
|
// For the submenu pager, If there are fewer than 4 dataset items, display the dataset item count, otherwise, show "Viewing 4..".
|
|
377
383
|
submenuItemsCount = resultsCount > defaultPageSize ? defaultPageSize : resultsCount;
|
|
@@ -4565,7 +4571,13 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
|
|
|
4565
4571
|
})}`);
|
|
4566
4572
|
}
|
|
4567
4573
|
});
|
|
4568
|
-
|
|
4574
|
+
// Sync totalItems state with API response data
|
|
4575
|
+
// Moved to useEffect to prevent state updates during render (which can cause infinite loops)
|
|
4576
|
+
(0, $hgUW1$useEffect)(()=>{
|
|
4577
|
+
if (data?.data?.total !== undefined && data.data.total !== totalItems) setTotalItems(data.data.total);
|
|
4578
|
+
}, [
|
|
4579
|
+
data?.data?.total
|
|
4580
|
+
]);
|
|
4569
4581
|
const facets = data && data.data.facets ? (0, $eff7d34c30f5a0fc$export$959638e8dca60ce6)(data ? data.data.facets : []) : {
|
|
4570
4582
|
theme: null,
|
|
4571
4583
|
keyword: null
|
|
@@ -4921,7 +4933,13 @@ const $550bcc185f420ff5$var$DatasetList = ({ rootUrl: rootUrl, enableSort: enabl
|
|
|
4921
4933
|
})}`);
|
|
4922
4934
|
}
|
|
4923
4935
|
});
|
|
4924
|
-
|
|
4936
|
+
// Sync totalItems state with API response data
|
|
4937
|
+
// Moved to useEffect to prevent state updates during render (which can cause infinite loops)
|
|
4938
|
+
(0, $hgUW1$useEffect)(()=>{
|
|
4939
|
+
if (data?.data?.total !== undefined && data.data.total !== totalItems) setTotalItems(data.data.total);
|
|
4940
|
+
}, [
|
|
4941
|
+
data?.data?.total
|
|
4942
|
+
]);
|
|
4925
4943
|
(0, $hgUW1$useEffect)(()=>{
|
|
4926
4944
|
// Update browser URL with current search params
|
|
4927
4945
|
const params = buildSearchParams(true);
|