فهرست منبع

refactoring in RecentCreated.jsx

zahmis 5 سال پیش
والد
کامیت
17c37a109f
1فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 3 3
      src/client/js/components/RecentCreated/RecentCreated.jsx

+ 3 - 3
src/client/js/components/RecentCreated/RecentCreated.jsx

@@ -12,12 +12,13 @@ class RecentCreated extends React.Component {
 
   constructor(props) {
     super(props);
+    const { appContainer } = this.props;
 
     this.state = {
       pages: [],
       activePage: 1,
       totalPages: 0,
-      pagingLimit: Infinity,
+      pagingLimit: appContainer.getConfig().pageLimitationM || 30,
     };
 
     this.handlePage = this.handlePage.bind(this);
@@ -34,9 +35,8 @@ class RecentCreated extends React.Component {
 
   async getRecentCreatedList(selectPageNumber) {
     const { appContainer, userId } = this.props;
-
     // const userId = appContainer.currentUserId;
-    const limit = appContainer.getConfig().pageLimitationM || 30;
+    const limit = this.state.pagingLimit;
     const offset = (selectPageNumber - 1) * limit;
 
     // pagesList get and pagination calculate