@swype-org/react-sdk 0.1.126 → 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.js CHANGED
@@ -7170,13 +7170,22 @@ function SwypePaymentInner({
7170
7170
  }, [pendingSelectSourceAction, selectSourceChoices, selectSourceRecommended]);
7171
7171
  useEffect(() => {
7172
7172
  if (pendingSelectSourceAction && (state.step === "processing" || state.step === "open-wallet" || state.step === "setup-status")) {
7173
- preSelectSourceStepRef.current = state.step;
7174
- dispatch({ type: "NAVIGATE", step: "select-source" });
7173
+ if (state.step === "setup-status") {
7174
+ const recommended = selectSourceRecommended;
7175
+ if (recommended) {
7176
+ authExecutor.resolveSelectSource(recommended);
7177
+ } else {
7178
+ authExecutor.resolveSelectSource({ chainName: "Base", tokenSymbol: "USDC" });
7179
+ }
7180
+ } else {
7181
+ preSelectSourceStepRef.current = state.step;
7182
+ dispatch({ type: "NAVIGATE", step: "select-source" });
7183
+ }
7175
7184
  } else if (!pendingSelectSourceAction && state.step === "select-source") {
7176
7185
  dispatch({ type: "NAVIGATE", step: preSelectSourceStepRef.current ?? "processing" });
7177
7186
  preSelectSourceStepRef.current = null;
7178
7187
  }
7179
- }, [pendingSelectSourceAction, state.step]);
7188
+ }, [pendingSelectSourceAction, state.step, selectSourceRecommended, authExecutor]);
7180
7189
  useEffect(() => {
7181
7190
  if (!pendingSelectSourceAction || !pendingTokenAuthRef.current) return;
7182
7191
  const { tokenAddress, chainId } = pendingTokenAuthRef.current;