@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.
package/dist/forms.js CHANGED
@@ -660,7 +660,7 @@ function AuthEmailVerificationStep({
660
660
  emailSent = false
661
661
  }) {
662
662
  const { sendVerificationEmail } = useInsforge();
663
- const [resendDisabled, setResendDisabled] = useState(true);
663
+ const [resendDisabled, setResendDisabled] = useState(emailSent ? true : false);
664
664
  const [resendCountdown, setResendCountdown] = useState(emailSent ? 60 : 0);
665
665
  const [isSending, setIsSending] = useState(false);
666
666
  const [verificationCode, setVerificationCode] = useState("");
@@ -668,7 +668,7 @@ function AuthEmailVerificationStep({
668
668
  const isLinkMethod = method === "link";
669
669
  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.";
670
670
  useEffect(() => {
671
- if (emailSent && resendCountdown > 0) {
671
+ if (resendDisabled && resendCountdown > 0) {
672
672
  const timer = setInterval(() => {
673
673
  setResendCountdown((prev) => {
674
674
  if (prev <= 1) {
@@ -680,7 +680,7 @@ function AuthEmailVerificationStep({
680
680
  }, 1e3);
681
681
  return () => clearInterval(timer);
682
682
  }
683
- }, [emailSent, resendCountdown]);
683
+ }, [resendDisabled, resendCountdown]);
684
684
  const handleResend = async () => {
685
685
  setResendDisabled(true);
686
686
  setResendCountdown(60);