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

81100 fix unnecessary func calling and replece comment position

SULLEY\ryo-h 4 лет назад
Родитель
Сommit
4df1fbc479
1 измененных файлов с 1 добавлено и 3 удалено
  1. 1 3
      packages/app/src/components/SearchPage.jsx

+ 1 - 3
packages/app/src/components/SearchPage.jsx

@@ -214,16 +214,14 @@ class SearchPage extends React.Component {
   toggleAllCheckBox = () => {
     if (this.state.selectedPages.size === this.state.searchedPages.length) {
       this.state.selectedPages.clear();
-      // Force a render to tell React that the State has been changed by the Set class method
-      this.forceUpdate();
     }
     else {
       this.state.searchedPages.forEach((page) => {
         this.state.selectedPages.add(page);
       });
     }
-    // Force a render to tell React that the State has been changed by the Set class method
     this.updateCheckboxState();
+    // Force a render to tell React that the State has been changed by the Set class method
     this.forceUpdate();
   };