kaori 4 лет назад
Родитель
Сommit
a77fee26a6
1 измененных файлов с 10 добавлено и 3 удалено
  1. 10 3
      src/client/js/components/LoginForm.jsx

+ 10 - 3
src/client/js/components/LoginForm.jsx

@@ -14,6 +14,7 @@ class LoginForm extends React.Component {
 
     this.state = {
       isRegistering: false,
+      isPasswordResetEnabled: false,
     };
 
     this.switchForm = this.switchForm.bind(this);
@@ -29,6 +30,10 @@ class LoginForm extends React.Component {
     }
   }
 
+  componentDidMount() {
+    this.setState({ isPasswordResetEnabled: true });
+  }
+
   switchForm() {
     this.setState({ isRegistering: !this.state.isRegistering });
   }
@@ -268,9 +273,11 @@ class LoginForm extends React.Component {
                 {isRegistrationEnabled && (
                 <div className="row">
                   <div className="col-12 text-right py-2">
-                    <a href="/forgot-password" className="d-block link-switch mb-1">
-                      <i className="icon-key"></i> {t('forgot_password')}
-                    </a>
+                    {this.state.isPasswordResetEnable && (
+                      <a href="/forgot-password" className="d-block link-switch mb-1">
+                        <i className="icon-key"></i> {t('forgot_password')}
+                      </a>
+                    )}
                     <a href="#register" id="register" className="link-switch" onClick={this.switchForm}>
                       <i className="ti-check-box"></i> {t('Sign up is here')}
                     </a>