@swype-org/react-sdk 0.1.268 → 0.1.271

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.cjs CHANGED
@@ -6818,7 +6818,7 @@ function useAuthHandlers(dispatch, verificationTarget) {
6818
6818
  handleResendLoginCode
6819
6819
  };
6820
6820
  }
6821
- function usePasskeyHandlers(dispatch, apiBaseUrl, accounts, knownCredentialIds, mobileSetupFlowRef, guestPreauthAccountId) {
6821
+ function usePasskeyHandlers(dispatch, apiBaseUrl, accounts, knownCredentialIds) {
6822
6822
  const { user, getAccessToken } = reactAuth.usePrivy();
6823
6823
  const checkingPasskeyRef = react.useRef(false);
6824
6824
  const activateExistingCredential = react.useCallback(async (credentialId) => {
@@ -8679,7 +8679,7 @@ function useMobilePollingEffect(deps) {
8679
8679
  handlingMobileReturnRef.current = false;
8680
8680
  return;
8681
8681
  }
8682
- if (state.isGuestFlow && state.guestPreauthSessionId != null && mobileSetupFlowRef.current) {
8682
+ if (state.isGuestFlow && state.guestPreauthSessionId != null) {
8683
8683
  return;
8684
8684
  }
8685
8685
  if (handlingMobileReturnRef.current) return;
@@ -8695,9 +8695,9 @@ function useMobilePollingEffect(deps) {
8695
8695
  mobileSetupFlowRef
8696
8696
  ]);
8697
8697
  react.useEffect(() => {
8698
- if (!state.mobileFlow || !mobileSetupFlowRef.current) return;
8699
- if (!setupAccountIdRef.current) return;
8700
- if (!state.guestPreauthSessionId || !state.isGuestFlow) return;
8698
+ if (!state.mobileFlow || !state.isGuestFlow || !state.guestPreauthSessionId || !state.guestPreauthAccountId) {
8699
+ return;
8700
+ }
8701
8701
  const guestToken = state.guestSessionToken ?? loadMobileFlowState()?.guestSessionToken ?? null;
8702
8702
  const preauthAccountId = state.guestPreauthAccountId;
8703
8703
  const preauthSessionId = state.guestPreauthSessionId;
@@ -8767,8 +8767,8 @@ function useMobilePollingEffect(deps) {
8767
8767
  const handleVisibility = () => {
8768
8768
  if (document.visibilityState === "visible" && !cancelled) void pollGuestAccount();
8769
8769
  };
8770
- const handlePageShow = (e) => {
8771
- if (e.persisted && !cancelled) void pollGuestAccount();
8770
+ const handlePageShow = () => {
8771
+ if (document.visibilityState === "visible" && !cancelled) void pollGuestAccount();
8772
8772
  };
8773
8773
  document.addEventListener("visibilitychange", handleVisibility);
8774
8774
  window.addEventListener("pageshow", handlePageShow);
@@ -8786,9 +8786,7 @@ function useMobilePollingEffect(deps) {
8786
8786
  state.guestPreauthAccountId,
8787
8787
  apiBaseUrl,
8788
8788
  reloadAccounts,
8789
- dispatch,
8790
- mobileSetupFlowRef,
8791
- setupAccountIdRef
8789
+ dispatch
8792
8790
  ]);
8793
8791
  react.useEffect(() => {
8794
8792
  if (!state.mobileFlow || !mobileSetupFlowRef.current) return;
@@ -8895,6 +8893,8 @@ function useMobilePollingEffect(deps) {
8895
8893
  react.useEffect(() => {
8896
8894
  if (!state.mobileFlow) return;
8897
8895
  if (handlingMobileReturnRef.current) return;
8896
+ const isGuestPostPayPreauthMobile = state.isGuestFlow && state.guestPreauthSessionId != null && state.guestPreauthAccountId != null;
8897
+ if (isGuestPostPayPreauthMobile) return;
8898
8898
  const transferIdToResume = pollingTransferIdRef.current ?? state.transfer?.id;
8899
8899
  if (!transferIdToResume) return;
8900
8900
  if (!polling.isPolling) polling.startPolling(transferIdToResume);
@@ -8917,6 +8917,9 @@ function useMobilePollingEffect(deps) {
8917
8917
  }, [
8918
8918
  state.mobileFlow,
8919
8919
  state.transfer?.id,
8920
+ state.isGuestFlow,
8921
+ state.guestPreauthSessionId,
8922
+ state.guestPreauthAccountId,
8920
8923
  polling.isPolling,
8921
8924
  polling.startPolling,
8922
8925
  handlingMobileReturnRef,
@@ -8992,8 +8995,8 @@ function useGuestPreauthMobileRestoreEffect(deps) {
8992
8995
  const handlePollVisibility = () => {
8993
8996
  if (document.visibilityState === "visible" && !cancelled) void pollGuestAccount();
8994
8997
  };
8995
- const handlePollPageShow = (e) => {
8996
- if (e.persisted && !cancelled) void pollGuestAccount();
8998
+ const handlePollPageShow = () => {
8999
+ if (document.visibilityState === "visible" && !cancelled) void pollGuestAccount();
8997
9000
  };
8998
9001
  document.addEventListener("visibilitychange", handlePollVisibility);
8999
9002
  window.addEventListener("pageshow", handlePollPageShow);
@@ -9011,8 +9014,8 @@ function useGuestPreauthMobileRestoreEffect(deps) {
9011
9014
  const onOuterVisibility = () => {
9012
9015
  if (document.visibilityState === "visible") tryStart();
9013
9016
  };
9014
- const onOuterPageShow = (e) => {
9015
- if (e.persisted) tryStart();
9017
+ const onOuterPageShow = () => {
9018
+ if (document.visibilityState === "visible") tryStart();
9016
9019
  };
9017
9020
  tryStart();
9018
9021
  document.addEventListener("visibilitychange", onOuterVisibility);
@@ -9334,9 +9337,7 @@ function BlinkPaymentInner({
9334
9337
  dispatch,
9335
9338
  apiBaseUrl,
9336
9339
  state.accounts,
9337
- state.knownCredentialIds,
9338
- mobileFlowRefs.mobileSetupFlowRef,
9339
- state.guestPreauthAccountId
9340
+ state.knownCredentialIds
9340
9341
  );
9341
9342
  const transfer = useTransferHandlers({
9342
9343
  dispatch,