Просмотр исходного кода

add || 10 or 30 in other files

zahmis 5 лет назад
Родитель
Сommit
759672a168

+ 1 - 1
src/client/js/components/MyBookmarkList/MyBookmarkList.jsx

@@ -43,7 +43,7 @@ class MyBookmarkList extends React.Component {
     const userId = appContainer.currentUserId;
     /* TODO #2 change variable name in database keys */
     /* TODO #3 write migration */
-    const limit = appContainer.getConfig().pageLimitationM;
+    const limit = appContainer.getConfig().pageLimitationM || 30;
     const page = selectPageNumber;
     const params = { page, limit };
 

+ 1 - 1
src/client/js/components/MyDraftList/MyDraftList.jsx

@@ -69,7 +69,7 @@ class MyDraftList extends React.Component {
   getCurrentDrafts(selectPageNumber) {
     const { appContainer } = this.props;
     // [TODO: rename pageLimitationM to pageLimitationL]
-    const limit = appContainer.getConfig().pageLimitationM;
+    const limit = appContainer.getConfig().pageLimitationM || 30;
 
     const totalDrafts = this.state.drafts.length;
     const activePage = selectPageNumber;

+ 1 - 1
src/client/js/components/PageList.jsx

@@ -18,7 +18,7 @@ const PageList = (props) => {
 
   const [activePage, setActivePage] = useState(1);
   const [totalPages, setTotalPages] = useState(0);
-  const [limit, setLimit] = useState(appContainer.getConfig().pageLimitationS);
+  const [limit, setLimit] = useState(appContainer.getConfig().pageLimitationS || 10);
   const [offset, setOffset] = useState(0);
 
   function setPageNumber(selectedPageNumber) {

+ 1 - 1
src/client/js/components/PageTimeline.jsx

@@ -20,7 +20,7 @@ class PageTimeline extends React.Component {
     this.state = {
       activePage: 1,
       totalPageItems: 0,
-      limit: appContainer.getConfig().pageLimitationS,
+      limit: appContainer.getConfig().pageLimitationS || 10,
 
       // TODO: remove after when timeline is implemented with React and inject data with props
       pages: this.props.pages,

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

@@ -36,7 +36,7 @@ class RecentCreated extends React.Component {
     const { appContainer, userId } = this.props;
 
     // const userId = appContainer.currentUserId;
-    const limit = appContainer.getConfig().pageLimitationM;
+    const limit = appContainer.getConfig().pageLimitationM || 30;
     const offset = (selectPageNumber - 1) * limit;
 
     // pagesList get and pagination calculate

+ 1 - 1
src/client/js/services/PageHistoryContainer.js

@@ -28,7 +28,7 @@ export default class PageHistoryContainer extends Container {
 
       totalPages: 0,
       activePage: 1,
-      pagingLimit: this.appContainer.getConfig().pageLimitationS,
+      pagingLimit: this.appContainer.getConfig().pageLimitationS || 10,
     };
 
     this.retrieveRevisions = this.retrieveRevisions.bind(this);