@swype-org/react-sdk 0.1.125 → 0.1.127

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
@@ -7173,13 +7173,22 @@ function SwypePaymentInner({
7173
7173
  }, [pendingSelectSourceAction, selectSourceChoices, selectSourceRecommended]);
7174
7174
  react.useEffect(() => {
7175
7175
  if (pendingSelectSourceAction && (state.step === "processing" || state.step === "open-wallet" || state.step === "setup-status")) {
7176
- preSelectSourceStepRef.current = state.step;
7177
- dispatch({ type: "NAVIGATE", step: "select-source" });
7176
+ if (state.step === "setup-status") {
7177
+ const recommended = selectSourceRecommended;
7178
+ if (recommended) {
7179
+ authExecutor.resolveSelectSource(recommended);
7180
+ } else {
7181
+ authExecutor.resolveSelectSource({ chainName: "Base", tokenSymbol: "USDC" });
7182
+ }
7183
+ } else {
7184
+ preSelectSourceStepRef.current = state.step;
7185
+ dispatch({ type: "NAVIGATE", step: "select-source" });
7186
+ }
7178
7187
  } else if (!pendingSelectSourceAction && state.step === "select-source") {
7179
7188
  dispatch({ type: "NAVIGATE", step: preSelectSourceStepRef.current ?? "processing" });
7180
7189
  preSelectSourceStepRef.current = null;
7181
7190
  }
7182
- }, [pendingSelectSourceAction, state.step]);
7191
+ }, [pendingSelectSourceAction, state.step, selectSourceRecommended, authExecutor]);
7183
7192
  react.useEffect(() => {
7184
7193
  if (!pendingSelectSourceAction || !pendingTokenAuthRef.current) return;
7185
7194
  const { tokenAddress, chainId } = pendingTokenAuthRef.current;
@@ -7200,12 +7209,14 @@ function SwypePaymentInner({
7200
7209
  react.useEffect(() => {
7201
7210
  if (pendingOneTapSetupAction && state.step === "setup-status") {
7202
7211
  preOneTapSetupStepRef.current = state.step;
7203
- dispatch({ type: "NAVIGATE", step: "setup" });
7212
+ reloadAccounts().then(() => {
7213
+ dispatch({ type: "NAVIGATE", step: "setup" });
7214
+ });
7204
7215
  } else if (!pendingOneTapSetupAction && state.step === "setup" && preOneTapSetupStepRef.current) {
7205
7216
  dispatch({ type: "NAVIGATE", step: preOneTapSetupStepRef.current });
7206
7217
  preOneTapSetupStepRef.current = null;
7207
7218
  }
7208
- }, [pendingOneTapSetupAction, state.step]);
7219
+ }, [pendingOneTapSetupAction, state.step, reloadAccounts]);
7209
7220
  const handlers = react.useMemo(() => ({
7210
7221
  onSendLoginCode: handleSendLoginCode,
7211
7222
  onVerifyLoginCode: handleVerifyLoginCode,