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

* fix: error clearance

* changes

---------

Co-authored-by: Peer Richelsen <[email protected]>
Co-authored-by: Udit Takkar <[email protected]>
This commit is contained in:
authored and GitHub committed 2023-04-27 11:43:23 +00:00
1 parent 8a6c420268
commit 668ea088ef
2 files changed
+1 -4

No files matched your search

@@ -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>
@@ -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) => {