fix: disabled the button when both password are same (#3360)

This commit is contained in:
Palash Gupta 2023-08-17 14:35:56 +05:30 committed by GitHub
parent 9a6fcb6b1d
commit 5ac105beca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,6 +81,13 @@ function PasswordContainer(): JSX.Element {
}
};
const isDisabled =
isLoading ||
currentPassword.length === 0 ||
updatePassword.length === 0 ||
isPasswordPolicyError ||
currentPassword === updatePassword;
return (
<Space direction="vertical" size="large">
<Typography.Title level={3}>
@ -132,13 +139,7 @@ function PasswordContainer(): JSX.Element {
)}
</Space>
<Button
disabled={
isLoading ||
currentPassword.length === 0 ||
updatePassword.length === 0 ||
isPasswordPolicyError ||
currentPassword !== updatePassword
}
disabled={isDisabled}
loading={isLoading}
onClick={onChangePasswordClickHandler}
type="primary"