fix: Maximum update depth exceeded error when entering the 6th digit of the email verification code. (#24857)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@calcom/atoms": minor
|
||||
---
|
||||
|
||||
Fix Booker atom verify email dialog infinite re-render when entering verification code
|
||||
@@ -68,6 +68,7 @@ export const VerifyCodeDialog = ({
|
||||
value,
|
||||
email,
|
||||
verifyCodeWithSessionNotRequired,
|
||||
setVerificationCode,
|
||||
]);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -77,7 +78,8 @@ export const VerifyCodeDialog = ({
|
||||
if (hasVerified || error || isPending || !/^\d{6}$/.test(value.trim())) return;
|
||||
|
||||
verifyCode();
|
||||
}, [error, isPending, value, verifyCode, hasVerified]);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [error, isPending, value, hasVerified]);
|
||||
|
||||
useEffect(() => setValue(""), [isOpenDialog]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user