@swype-org/react-sdk 0.1.67 → 0.1.69

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
@@ -1613,6 +1613,9 @@ function resolvePostAuthStep(state) {
1613
1613
  return { step: "create-passkey", clearPersistedFlow: false };
1614
1614
  }
1615
1615
  if (state.persistedMobileFlow) {
1616
+ if (state.persistedMobileFlow.isSetup && hasActiveWallet(state.accounts)) {
1617
+ return { step: "deposit", clearPersistedFlow: true };
1618
+ }
1616
1619
  return { step: "open-wallet", clearPersistedFlow: false };
1617
1620
  }
1618
1621
  if ((state.accounts.length === 0 || !hasActiveWallet(state.accounts)) && !state.connectingNewAccount) {
@@ -1630,6 +1633,9 @@ function resolveRestoredMobileFlow(transferStatus, isSetup) {
1630
1633
  if (transferStatus === "FAILED") {
1631
1634
  return { kind: "resume-failed", step: "success", clearPersistedFlow: true };
1632
1635
  }
1636
+ if (isSetup) {
1637
+ return { kind: "resume-stale-setup", step: "wallet-picker", clearPersistedFlow: true };
1638
+ }
1633
1639
  return { kind: "resume-open-wallet", step: "open-wallet", clearPersistedFlow: false };
1634
1640
  }
1635
1641
  var FOOTER_CSS = `
@@ -4507,13 +4513,13 @@ function SwypePaymentInner({
4507
4513
  polling.startPolling(persisted.transferId);
4508
4514
  }, [polling]);
4509
4515
  const handleAuthorizedMobileReturn = react.useCallback(async (authorizedTransfer, isSetup) => {
4510
- setTransfer(authorizedTransfer);
4511
4516
  polling.stopPolling();
4512
4517
  if (isSetup) {
4513
4518
  mobileSetupFlowRef.current = false;
4514
4519
  clearMobileFlowState();
4515
4520
  try {
4516
4521
  await reloadAccounts();
4522
+ setTransfer(null);
4517
4523
  setError(null);
4518
4524
  setDeeplinkUri(null);
4519
4525
  setMobileFlow(false);
@@ -4526,6 +4532,7 @@ function SwypePaymentInner({
4526
4532
  }
4527
4533
  return;
4528
4534
  }
4535
+ setTransfer(authorizedTransfer);
4529
4536
  mobileSetupFlowRef.current = false;
4530
4537
  clearMobileFlowState();
4531
4538
  setError(null);
@@ -4682,6 +4689,11 @@ function SwypePaymentInner({
4682
4689
  setStep("success");
4683
4690
  return;
4684
4691
  }
4692
+ if (mobileResolution.kind === "resume-stale-setup") {
4693
+ clearMobileFlowState();
4694
+ if (!cancelled) setStep("wallet-picker");
4695
+ return;
4696
+ }
4685
4697
  } catch (err) {
4686
4698
  if (cancelled) return;
4687
4699
  enterPersistedMobileFlow(