Răsfoiți Sursa

124062 add handleEmailSent

soumaeda 2 ani în urmă
părinte
comite
c3e603da1f
1 a modificat fișierele cu 5 adăugiri și 0 ștergeri
  1. 5 0
      apps/app/src/components/Admin/Users/PasswordResetModal.jsx

+ 5 - 0
apps/app/src/components/Admin/Users/PasswordResetModal.jsx

@@ -43,6 +43,10 @@ class PasswordResetModal extends React.Component {
     toastSuccess('Copied Password');
     toastSuccess('Copied Password');
   }
   }
 
 
+  handleEmailSent() {
+    this.setState({ isEmailSent: true });
+  }
+
   renderButtons() {
   renderButtons() {
     const { t, isMailerSetup } = this.props;
     const { t, isMailerSetup } = this.props;
     const { isEmailSent } = this.state;
     const { isEmailSent } = this.state;
@@ -160,6 +164,7 @@ class PasswordResetModal extends React.Component {
     try {
     try {
       await apiv3Put('/users/reset-password-email', { id: userForPasswordResetModal._id, newPassword: this.state.temporaryPassword });
       await apiv3Put('/users/reset-password-email', { id: userForPasswordResetModal._id, newPassword: this.state.temporaryPassword });
       this.setState({ isEmailSent: true });
       this.setState({ isEmailSent: true });
+      this.handleEmailSent();
     }
     }
     catch (err) {
     catch (err) {
       toastError(err);
       toastError(err);