-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: mms-1876 swap pre populated #30929
base: main
Are you sure you want to change the base?
Conversation
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. |
Builds ready [8c6052c]
Page Load Metrics (2031 ± 149 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
@@ -754,6 +755,15 @@ export default function PrepareSwapPage({ | |||
} | |||
}, [showQuotesLoadingAnimation]); | |||
|
|||
// Set the default destination token for the swap | |||
useEffect(() => { | |||
if (!selectedToToken?.address && DEFAULT_TO_TOKEN_BY_NETWORK[chainId]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a condition here to skip pre-populating the toToken if the default token === fromToken?
Repro steps:
- From homepage, go to asset details page for the default token (i.e, USDC on ethereum)
- Click Swap from there
- See that the Swap page has USDC -> USDC filled in, which is an invalid route
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updating it.
Description
Set a default token populated when going to the swap page
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Screen.Recording.2025-03-12.at.11.44.16.mov
Pre-merge author checklist
Pre-merge reviewer checklist