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

add async and await and make setState isNotifyCommentShow

ryuichi-e 6 лет назад
Родитель
Сommit
73ce051011
1 измененных файлов с 4 добавлено и 4 удалено
  1. 4 4
      src/client/js/components/Admin/UserManagement.jsx

+ 4 - 4
src/client/js/components/Admin/UserManagement.jsx

@@ -40,15 +40,15 @@ class UserManagement extends React.Component {
    * For checking same check box twice
    * @param {string} statusType
    */
-  handleClick(statusType) {
+  async handleClick(statusType) {
     const { adminUsersContainer } = this.props;
     if (!this.validateToggleStatus(statusType)) {
-      adminUsersContainer.setNotifyComment('You should check at least one checkbox.');
+      await adminUsersContainer.setState({ isNotifyCommentShow: true });
       return;
     }
 
-    if (adminUsersContainer.state.notifyComment.length > 0) {
-      adminUsersContainer.setNotifyComment('');
+    if (adminUsersContainer.state.isNotifyCommentShow === true) {
+      await adminUsersContainer.setState({ isNotifyCommentShow: false });
     }
     adminUsersContainer.handleClick(statusType);
   }