fix: correct fiat no-quotes alert condition in useNoPayTokenQuotesAlert#30601
Conversation
537a660 to
40f7fdc
Compare
Replace `sourceAmounts?.length === 0` with `!fiatPayment?.rampsQuote` so the alert fires when a fiat payment method is selected with a valid amount but no ramps quote is available, regardless of whether sourceAmounts is populated.
40f7fdc to
e6e45af
Compare
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Direct impact:
Dependent tags (per tag descriptions):
Risk level: Medium — The change is a small logic fix but touches a blocking alert condition that could prevent users from proceeding in fiat, perps, and predictions flows. The fix is well-tested with new unit tests, but E2E validation is warranted for the affected flows. Performance Test Selection: |
|



Description
The fiat no-quotes alert in
useNoPayTokenQuotesAlertwas not firing when a fiat payment method was selected with a valid amount but no ramps quote was available.shouldShowFiatNoQuotesAlertrequiredsourceAmounts?.length === 0, but in fiat payment flowssourceAmountscan be populated (tokens the user needs) while no quote exists to fill them. This prevented the alert from ever showing.Replaced
sourceAmounts?.length === 0with!fiatPayment?.rampsQuoteso the alert fires based on the actual ramps quote availability rather than the source amounts array length. Also added two test cases covering the new condition.Changelog
CHANGELOG entry: Fixed fiat no-quotes alert not showing when paying with a card and no ramps quote is available
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Low Risk
Small confirmation-alert condition change with unit tests; no auth, payments execution, or broad refactors.
Overview
Fixes the fiat "no quotes" blocking alert on transaction confirmation so it reflects whether a ramps quote exists, not whether
sourceAmountsis empty.shouldShowFiatNoQuotesAlertpreviously requiredsourceAmounts?.length === 0, which often failed in card/fiat flows becausesourceAmountscan still list tokens the user must cover even when no ramps quote is available—so the danger alert never appeared. The condition now uses!fiatPayment?.rampsQuote(with quotes still empty and not loading). Tests cover no alert whenrampsQuoteis present and alert whensourceAmountsis non-empty butrampsQuoteis missing.Reviewed by Cursor Bugbot for commit e6e45af. Bugbot is set up for automated code reviews on this repo. Configure here.