fix: password not updatable after an api error (#8514)

* fix: error clearance

* changes

---------

Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
This commit is contained in:
Nafees Nazik 2023-04-27 17:13:23 +05:30 committed by GitHub
parent 8a6c420268
commit 668ea088ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 4 deletions

View File

@ -199,6 +199,7 @@ const PasswordView = () => {
color="primary"
className="mt-8"
type="submit"
onClick={() => formMethods.clearErrors("apiError")}
disabled={isDisabled || passwordMutation.isLoading || sessionMutation.isLoading}>
{t("update")}
</Button>

View File

@ -347,10 +347,6 @@ const PlainForm = <T extends FieldValues>(props: FormProps<T>, ref: Ref<HTMLForm
event.preventDefault();
event.stopPropagation();
if (form.formState?.errors?.apiError) {
form.clearErrors("root");
}
form
.handleSubmit(handleSubmit)(event)
.catch((err) => {