From 2a5075f434d21394a86e6977e3c6ce895ecb4681 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Fri, 4 May 2018 11:33:06 -0600 Subject: [PATCH] Form update --- .../client/components/ChangePassword.js | 43 +++++++++++-------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/plugins/talk-plugin-local-auth/client/components/ChangePassword.js b/plugins/talk-plugin-local-auth/client/components/ChangePassword.js index 04d420d22..8f86fff48 100644 --- a/plugins/talk-plugin-local-auth/client/components/ChangePassword.js +++ b/plugins/talk-plugin-local-auth/client/components/ChangePassword.js @@ -105,7 +105,13 @@ class ChangePassword extends React.Component { this.setState(initialState); }; - onSave = async () => { + onSave = async e => { + e.preventDefault(); + + if (this.isSubmitBlocked()) { + return; + } + const { oldPassword, newPassword } = this.state.formData; try { @@ -169,8 +175,11 @@ class ChangePassword extends React.Component {

{t('talk-plugin-local-auth.change_password.change_password')}

- {editing && ( -
+ {editing ? ( + +
+ + + {t('talk-plugin-local-auth.change_password.cancel')} + +
- )} - {editing ? ( -
- - - {t('talk-plugin-local-auth.change_password.cancel')} - -
) : (