mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 08:13:56 +10:00
fix: add conditional to useEffects
This commit is contained in:
@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user