@swype-org/react-sdk 0.1.130 → 0.1.131

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
@@ -6004,6 +6004,7 @@ function SwypePaymentInner({
6004
6004
  const initializedSelectSourceActionRef = useRef(null);
6005
6005
  const preSelectSourceStepRef = useRef(null);
6006
6006
  const pendingTokenAuthRef = useRef(null);
6007
+ const pendingTokenSelectionRef = useRef(null);
6007
6008
  const reauthSessionIdRef = useRef(null);
6008
6009
  const reauthTokenRef = useRef(null);
6009
6010
  const checkingPasskeyRef = useRef(false);
@@ -6505,7 +6506,8 @@ function SwypePaymentInner({
6505
6506
  dispatch({ type: "NAVIGATE", step: "setup-status" });
6506
6507
  await authExecutor.executeSessionById(session.id);
6507
6508
  await reloadAccounts();
6508
- dispatch({ type: "SELECT_TOKEN", walletId: _walletId, tokenSymbol });
6509
+ pendingTokenSelectionRef.current = { walletId: _walletId, tokenSymbol };
6510
+ dispatch({ type: "NAVIGATE", step: "setup" });
6509
6511
  }
6510
6512
  } catch (err) {
6511
6513
  captureException(err);
@@ -6655,6 +6657,10 @@ function SwypePaymentInner({
6655
6657
  await updateUserConfig(apiBaseUrl, token, { defaultAllowance: limit });
6656
6658
  if (authExecutor.pendingOneTapSetup) {
6657
6659
  authExecutor.resolveOneTapSetup();
6660
+ } else if (pendingTokenSelectionRef.current) {
6661
+ const sel = pendingTokenSelectionRef.current;
6662
+ pendingTokenSelectionRef.current = null;
6663
+ dispatch({ type: "SELECT_TOKEN", walletId: sel.walletId, tokenSymbol: sel.tokenSymbol });
6658
6664
  } else {
6659
6665
  dispatch({ type: "NAVIGATE", step: "deposit" });
6660
6666
  }
@@ -6673,6 +6679,7 @@ function SwypePaymentInner({
6673
6679
  processingStartedAtRef.current = null;
6674
6680
  pollingTransferIdRef.current = null;
6675
6681
  preSelectSourceStepRef.current = null;
6682
+ pendingTokenSelectionRef.current = null;
6676
6683
  dispatch({
6677
6684
  type: "NEW_PAYMENT",
6678
6685
  depositAmount,
@@ -6690,6 +6697,7 @@ function SwypePaymentInner({
6690
6697
  }
6691
6698
  polling.stopPolling();
6692
6699
  preSelectSourceStepRef.current = null;
6700
+ pendingTokenSelectionRef.current = null;
6693
6701
  checkingPasskeyRef.current = false;
6694
6702
  setAuthInput("");
6695
6703
  setOtpCode("");