@swype-org/react-sdk 0.1.115 → 0.1.116

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/index.js CHANGED
@@ -2166,7 +2166,7 @@ function paymentReducer(state, action) {
2166
2166
  };
2167
2167
  // ── Navigation & error ───────────────────────────────────────
2168
2168
  case "NAVIGATE":
2169
- return { ...state, step: action.step };
2169
+ return { ...state, step: action.step, error: null };
2170
2170
  case "SET_ERROR":
2171
2171
  return { ...state, error: action.error };
2172
2172
  // ── Lifecycle ────────────────────────────────────────────────
@@ -6660,11 +6660,11 @@ function SwypePaymentInner({
6660
6660
  }
6661
6661
  }, [depositAmount]);
6662
6662
  useEffect(() => {
6663
- if (authenticated) return;
6663
+ if (authenticated || state.step !== "otp-verify") return;
6664
6664
  if (activeOtpErrorMessage) dispatch({ type: "SET_ERROR", error: activeOtpErrorMessage });
6665
- }, [activeOtpErrorMessage, authenticated]);
6665
+ }, [activeOtpErrorMessage, authenticated, state.step]);
6666
6666
  useEffect(() => {
6667
- if (state.step === "otp-verify" && /^\d{6}$/.test(otpCode.trim()) && activeOtpStatus !== "submitting-code") {
6667
+ if (state.step === "otp-verify" && /^\d{6}$/.test(otpCode.trim()) && activeOtpStatus === "awaiting-code-input") {
6668
6668
  handleVerifyLoginCode();
6669
6669
  }
6670
6670
  }, [otpCode, state.step, activeOtpStatus, handleVerifyLoginCode]);