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

79625 remove comments & change state var names

Yohei-Shiina 4 лет назад
Родитель
Сommit
8f94c82daf

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

@@ -32,8 +32,8 @@ class SearchPage extends React.Component {
       searchResultMeta: {},
       selectedPage: {},
       selectedPages: new Set(),
-      includeUsersHome: false,
-      includeTrash: false,
+      excludeUsersHome: true,
+      exxcludeTrash: true,
     };
 
     this.changeURL = this.changeURL.bind(this);
@@ -64,11 +64,11 @@ class SearchPage extends React.Component {
   }
 
   onIncludeUsersHome() {
-    this.setState({ includeUsersHome: !this.state.includeUsersHome });
+    this.setState({ excludeUsersHome: !this.state.excludeUsersHome });
   }
 
   onIncludeTrash() {
-    this.setState({ includeTrash: !this.state.includeTrash });
+    this.setState({ exxcludeTrash: !this.state.exxcludeTrash });
   }
 
   changeURL(keyword, refreshHash) {
@@ -86,10 +86,10 @@ class SearchPage extends React.Component {
     let query = keyword;
 
     // pages included in specific path are not retrived when prefix is added
-    if (this.state.includeTrash) {
+    if (this.state.exxcludeTrash) {
       query = `${query} -prefix:${specificPathNames.trash}`;
     }
-    if (this.state.includeUsersHome) {
+    if (this.state.excludeUsersHome) {
       query = `${query} -prefix:${specificPathNames.user}`;
     }
 

+ 0 - 2
packages/app/src/components/SearchPage/SearchControl.tsx

@@ -40,7 +40,6 @@ const SearchControl: FC <Props> = (props: Props) => {
       </div>
       {/* TODO: replace the following elements deleteAll button , relevance button and include specificPath button component */}
       <div className="d-flex my-4">
-        {/* ボタン1 */}
         <div className="d-flex align-items-center border rounded border-gray px-2 py-1 mr-2 ml-auto">
           <label className="my-0 mr-2" htmlFor="flexCheckDefault">
             {t('Include Subordinated Target Page', { target: '/user' })}
@@ -51,7 +50,6 @@ const SearchControl: FC <Props> = (props: Props) => {
             onClick={() => onIncludeUsersHome()}
           />
         </div>
-        {/* ボタン2 */}
         <div className="d-flex align-items-center border rounded border-gray px-2 mr-3">
           <label className="my-0 mr-2" htmlFor="flexCheckChecked">
             {t('Include Subordinated Target Page', { target: '/trash' })}