chore: added form reset for onCancel

Signed-off-by: Adithya Krishna <aadithya794@gmail.com>
This commit is contained in:
Adithya Krishna
2024-03-08 23:25:02 +05:30
parent b9b57f16c0
commit 03e6388968
2 changed files with 20 additions and 2 deletions

View File

@ -197,7 +197,16 @@ export const EnableAuthenticatorAppDialog = ({
/> />
<DialogFooter> <DialogFooter>
<Button type="button" variant="secondary" onClick={() => onOpenChange(false)}> <Button
type="button"
variant="secondary"
onClick={() => {
setupTwoFactorAuthenticationForm.reset({
password: '',
});
onOpenChange(false);
}}
>
Cancel Cancel
</Button> </Button>

View File

@ -138,7 +138,16 @@ export const ViewRecoveryCodesDialog = ({ open, onOpenChange }: ViewRecoveryCode
/> />
<DialogFooter> <DialogFooter>
<Button type="button" variant="secondary" onClick={() => onOpenChange(false)}> <Button
type="button"
variant="secondary"
onClick={() => {
viewRecoveryCodesForm.reset({
password: '',
});
onOpenChange(false);
}}
>
Cancel Cancel
</Button> </Button>