@insforge/react 0.5.9 → 0.5.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -680,7 +680,7 @@ function AuthEmailVerificationStep({
680
680
  emailSent = false
681
681
  }) {
682
682
  const { sendVerificationEmail } = useInsforge();
683
- const [resendDisabled, setResendDisabled] = useState(true);
683
+ const [resendDisabled, setResendDisabled] = useState(emailSent ? true : false);
684
684
  const [resendCountdown, setResendCountdown] = useState(emailSent ? 60 : 0);
685
685
  const [isSending, setIsSending] = useState(false);
686
686
  const [verificationCode, setVerificationCode] = useState("");
@@ -688,7 +688,7 @@ function AuthEmailVerificationStep({
688
688
  const isLinkMethod = method === "link";
689
689
  const displayDescription = isLinkMethod ? "We've sent an email to {email}. Please check your email to confirm your account before signing in. The confirmation link expires in 10 minutes." : "We've sent a verification code to your inbox at {email}. Enter it below to proceed.";
690
690
  useEffect(() => {
691
- if (emailSent && resendCountdown > 0) {
691
+ if (resendDisabled && resendCountdown > 0) {
692
692
  const timer = setInterval(() => {
693
693
  setResendCountdown((prev) => {
694
694
  if (prev <= 1) {
@@ -700,7 +700,7 @@ function AuthEmailVerificationStep({
700
700
  }, 1e3);
701
701
  return () => clearInterval(timer);
702
702
  }
703
- }, [emailSent, resendCountdown]);
703
+ }, [resendDisabled, resendCountdown]);
704
704
  const handleResend = async () => {
705
705
  setResendDisabled(true);
706
706
  setResendCountdown(60);