2
0
Эх сурвалжийг харах

79903 remove unnecessary codes / leave and modify comments

Yohei-Shiina 4 жил өмнө
parent
commit
fc8f03553b

+ 2 - 2
packages/app/src/components/SearchPage.jsx

@@ -102,7 +102,7 @@ class SearchPage extends React.Component {
 
   onPageChagned = (activePage) => {
     this.setState({ activePage });
-    // send activePage to the search method as the above setState does not immediately change the activePage state
+    // pass the activePage to the search method as the above setState does not immediately change the state
     this.search({ keyword: this.state.searchedKeyword, activePage });
   }
 
@@ -125,7 +125,7 @@ class SearchPage extends React.Component {
       searchingKeyword: keyword,
     });
     const pagingLimit = this.state.pagingLimit;
-    const activePage = data.activePage || 1;
+    const activePage = data.activePage || 1; // has activePage only when pagination number clicked
     const offset = (activePage * pagingLimit) - pagingLimit;
     this.props.appContainer.apiGet('/search', {
       q: this.createSearchQuery(keyword),

+ 5 - 7
packages/app/src/components/SearchPage/SearchResultList.jsx

@@ -14,13 +14,11 @@ class SearchResultList extends React.Component {
         //         when keyword is not in page content, display revisionBody.
         // TASK : https://estoc.weseek.co.jp/redmine/issues/79606
           return (
-            <>
-              <SearchResultListItem
-                page={page}
-                onClickInvoked={this.props.onClickInvoked}
-                noLink
-              />
-            </>
+            <SearchResultListItem
+              page={page}
+              onClickInvoked={this.props.onClickInvoked}
+              noLink
+            />
           );
         })}
         <div className="my-4 mx-auto">