@salesgenterp/ui-components 0.4.532 → 0.4.533

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/index.js CHANGED
@@ -10642,7 +10642,8 @@ var StaticPageList = function StaticPageList(_ref) {
10642
10642
  var _sortBy;
10643
10643
  var apiEndPoint = _ref.apiEndPoint,
10644
10644
  queryParams = _ref.queryParams,
10645
- itemLink = _ref.itemLink;
10645
+ itemLink = _ref.itemLink,
10646
+ pageData = _ref.pageData;
10646
10647
  var _useState = React.useState(false),
10647
10648
  loading = _useState[0],
10648
10649
  setLoading = _useState[1];
@@ -10652,30 +10653,37 @@ var StaticPageList = function StaticPageList(_ref) {
10652
10653
  React.useEffect(function () {
10653
10654
  (function () {
10654
10655
  try {
10655
- var _temp3 = function () {
10656
- if (apiEndPoint) {
10657
- var _temp2 = function _temp2() {
10658
- setLoading(false);
10659
- };
10660
- setLoading(true);
10661
- var _temp = _catch(function () {
10662
- return Promise.resolve(API({
10663
- apiEndPoint: apiEndPoint,
10664
- url: "/ecommerce/staticPage/list?page=0&size=9999",
10665
- queryParams: queryParams
10666
- })).then(function (response) {
10667
- setStaticPageData(response === null || response === void 0 ? void 0 : response.content);
10668
- });
10669
- }, function () {});
10670
- return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
10656
+ var _temp4 = function () {
10657
+ if (pageData) {
10658
+ setStaticPageData(pageData);
10659
+ } else {
10660
+ var _temp3 = function () {
10661
+ if (apiEndPoint) {
10662
+ var _temp2 = function _temp2() {
10663
+ setLoading(false);
10664
+ };
10665
+ setLoading(true);
10666
+ var _temp = _catch(function () {
10667
+ return Promise.resolve(API({
10668
+ apiEndPoint: apiEndPoint,
10669
+ url: "/ecommerce/staticPage/list?page=0&size=999",
10670
+ queryParams: queryParams
10671
+ })).then(function (response) {
10672
+ setStaticPageData(response === null || response === void 0 ? void 0 : response.content);
10673
+ });
10674
+ }, function () {});
10675
+ return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
10676
+ }
10677
+ }();
10678
+ if (_temp3 && _temp3.then) return _temp3.then(function () {});
10671
10679
  }
10672
10680
  }();
10673
- return _temp3 && _temp3.then ? _temp3.then(function () {}) : void 0;
10681
+ return _temp4 && _temp4.then ? _temp4.then(function () {}) : void 0;
10674
10682
  } catch (e) {
10675
10683
  Promise.reject(e);
10676
10684
  }
10677
10685
  })();
10678
- }, []);
10686
+ }, [pageData]);
10679
10687
  return /*#__PURE__*/React__default.createElement("div", {
10680
10688
  style: {
10681
10689
  padding: '1rem'