Conversation
The component change guards the selector behind transactionMeta existence, preventing users from opening the pay modal before the transaction is initialized — which would show incomplete state (missing Predict balance). The styling condition was also aligned to use canEdit consistently.
Adds useNoPayTokenQuotesAlert to the buy conditions and error hooks, matching the Perps pay-with-any-token error handling. When a relay quote fails or returns empty, users now see a blocking error instead of an indefinite loading state.
…other flows Reject pending unapproved transactions before initializing the deposit-and-order batch, and guard the pay-with row so it only enables for predictDepositAndOrder transactions — preventing the token selector from picking up unrelated approvals.
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8b7f9c5. Configure here.
...Predict/views/PredictBuyWithAnyToken/components/PredictPayWithRow/PredictPayWithRow.test.tsx
Outdated
Show resolved
Hide resolved
app/components/UI/Predict/views/PredictBuyWithAnyToken/hooks/usePredictBuyConditions.ts
Outdated
Show resolved
Hide resolved
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Tag selection rationale:
No other tags are needed as changes are fully contained within the Predict feature and don't touch shared navigation, account management, network, swap, or other unrelated flows. Performance Test Selection: |
|
|
✅ E2E Fixture Validation — Schema is up to date |




Description
A user reported that the "Pay with" token selector on
PredictBuyWithAnyTokenwasn't allowing to select a different token. A transaction is needed to that work and the current logic could pick up pending approvals from unrelated flows (bridge, swap, send, etc.), allowing them to select tokens from the wrong transaction context.Root cause:
initPayWithAnyToken()callsaddTransactionBatch()directly without first rejecting existing pending approvals — unlike the standalonepredictDepositflow which goes throughuseConfirmNavigationand rejects all unapproved transactions before creating its own. When stale approvals existed,useApprovalRequest()returned the first (wrong) approval, andPredictPayWithRowenabled token selection based on a generictransactionMetatruthiness check.Fix (defense-in-depth):
usePredictBuyActions— addedrejectPendingTransactions()in thetransitionEndhandler beforeinitPayWithAnyToken(), mirroring the cleanup pattern fromuseConfirmNavigation.PredictPayWithRow— replaced the generictransactionMetatruthiness check withhasTransactionType(transactionMeta, [TransactionType.predictDepositAndOrder]), so the selector only enables for the correct transaction type.This branch also includes prior commits that handle no-quotes blocking alerts in the buy flow and disable the pay-with selector until transaction metadata is ready.
Changelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
N/A
After
N/A
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Touches transaction/approval handling in the Predict buy flow by programmatically rejecting unapproved transactions and tightening when the pay-with selector is enabled; regressions could affect in-flight approvals or block token selection.
Overview
Prevents the
PredictBuyWithAnyTokenpay-with token selector from latching onto stale approvals from other flows.On screen entry,
usePredictBuyActionsnow rejects allunapprovedtransactions before callinginitPayWithAnyToken, andPredictPayWithRowonly enables navigation/UI affordances when the currenttransactionMetais aTransactionType.predictDepositAndOrder(otherwise it disables press, hides the arrow, and removes the muted background). The buy flow also propagates blocking pay alerts (insufficient balance / no quotes) viausePredictBuyInfointousePredictBuyConditionsandusePredictBuyErrorto disable placing bets and surface the correct blocking message, with updated tests.Reviewed by Cursor Bugbot for commit 69b5397. Bugbot is set up for automated code reviews on this repo. Configure here.