mirror of
https://github.com/documenso/documenso
synced 2026-05-24 09:28:27 +00:00
fix: add conditional to useEffects
This commit is contained in:
parent
afe99e5ec9
commit
c744482b84
2 changed files with 8 additions and 4 deletions
|
|
@ -150,8 +150,10 @@ export const EnableAuthenticatorAppDialog = ({
|
|||
};
|
||||
|
||||
useEffect(() => {
|
||||
// Reset the form when the Dialog open state changes
|
||||
setupTwoFactorAuthenticationForm.reset();
|
||||
// Reset the form when the Dialog closes
|
||||
if (!open) {
|
||||
setupTwoFactorAuthenticationForm.reset();
|
||||
}
|
||||
}, [open, setupTwoFactorAuthenticationForm]);
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -93,8 +93,10 @@ export const ViewRecoveryCodesDialog = ({ open, onOpenChange }: ViewRecoveryCode
|
|||
};
|
||||
|
||||
useEffect(() => {
|
||||
// Reset the form when the Dialog open state changes
|
||||
viewRecoveryCodesForm.reset();
|
||||
// Reset the form when the Dialog closes
|
||||
if (!open) {
|
||||
viewRecoveryCodesForm.reset();
|
||||
}
|
||||
}, [open, viewRecoveryCodesForm]);
|
||||
|
||||
return (
|
||||
|
|
|
|||
Loading…
Reference in a new issue