fix: Phantom in-app browser race condition + CheckoutMode improvements#55
Conversation
In Phantom's in-app browser, Solana auto-connects via wallet-standard while force EVM connect fires simultaneously. The auto-navigate effect was running before EVM connected, causing premature navigation to SELECT_TOKEN (Solana-only view) before both chains settled. Added a guard: if force EVM connect is pending and EVM isn't connected yet, return early to wait. Added a 10s safety timeout to clear the flag if EVM never connects (user rejection fallback).
When URL contains ?paymentId=xxx, the component: - Reads payment ID from URL on mount - Sets it as the payment ID - Auto-opens the PayModal - Cleans up URL to prevent re-triggering on refresh Also bumps version to 0.1.38-beta.4
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0ec72f600f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…sk deeplink domain
shawnmuggle
left a comment
There was a problem hiding this comment.
Approved — no P0/P1.
Core fix is correct: the didForceEvmConnect && !isEthConnected guard plus the ethStatus/isSolanaConnecting settling checks properly block the premature jump to SELECT_TOKEN in the Phantom in-app browser, and the 10s safety timeout prevents a stuck SELECT_METHOD on user rejection. The useRef→useState migration is the right call so dependent effects re-trigger.
Non-blocking notes:
didForceEvmConnectis intentionally omitted from the force-connect effect's deps (only added to the auto-navigate effect) to avoid clearing the 10s timer early — correct but subtle; a one-line comment would help future readers.showRef.current = showis assigned during render; works, mildly against React guidance, fine for an example app.- Wallet deeplinks are hardcoded for the demo — fine.
Summary
Fixes wallet auto-connect race condition in Phantom in-app browser and adds CheckoutMode quality-of-life features.
Changes
1. Fix: Phantom in-app browser race condition (
RozoPayModal/index.tsx)didForceEvmConnectRefguard: blocks auto-navigate until forced EVM connect resolves2. feat:
?paymentIdquery param (CheckoutMode.tsx)?paymentId=XXXfrom URL, sets paymentId, cleans URL viareplaceState3. feat: Wallet deeplink logos (
CheckoutMode.tsx)/checkout?paymentId=XXX)@web3icons/reactbranded icons4. Version bump
@rozoai/intent-pay:0.1.38-beta.3→0.1.38-beta.4