Explorar el Código

add validetion

akira-s hace 6 años
padre
commit
d70a66738a
Se han modificado 1 ficheros con 9 adiciones y 1 borrados
  1. 9 1
      src/client/js/components/Admin/UserManagement.jsx

+ 9 - 1
src/client/js/components/Admin/UserManagement.jsx

@@ -36,7 +36,15 @@ class UserManagement extends React.Component {
   }
 
   handleClick(statusType) {
-    this.props.adminUsersContainer.handleClick(statusType);
+    if (this.validateToggleStatus(statusType)) this.props.adminUsersContainer.handleClick(statusType);
+  }
+
+  validateToggleStatus(statusType) {
+    if (this.props.adminUsersContainer.isSelected(statusType)) {
+      // if else status is selected, then true
+      return this.props.adminUsersContainer.state.selectedStatusList.size > 1;
+    }
+    return true;
   }