-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
fix: enable earn button navigation on unsupported networks #12988
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. |
50fb2ff
to
34d989a
Compare
This update introduces a check for staking support based on the current chain before proceeding with staking actions. It integrates the `useStakingChain` hook to determine if the active chain supports staking, and sets the active network to 'mainnet' if it does not.
34d989a
to
db2fb3c
Compare
Bitrise🔄🔄🔄 Commit hash: db2fb3c Note
|
Bitrise❌❌❌ Commit hash: 1971ee3 Note
Tip
|
Quality Gate passedIssues Measures |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12988 +/- ##
==========================================
- Coverage 59.83% 59.82% -0.02%
==========================================
Files 1873 1873
Lines 42121 42124 +3
Branches 5473 5474 +1
==========================================
- Hits 25204 25201 -3
- Misses 15235 15240 +5
- Partials 1682 1683 +1 ☔ View full report in Codecov by Sentry. |
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.
I've tested the fix successfully locally. LGTM!
Description
This PR fixes Earn CTA navigation behavior when clicked on unsupported networks. Previously, the button was unresponsive or navigated to Portfolio screen when clicked on networks that don't support staking. Now, it properly switches to mainnet and navigates to the staking UI.
Related issues
Manual testing steps
Screenshots/Recordings
Before
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-01-15.at.08.40.50.mp4
After
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-01-15.at.08.43.34.mp4
Pre-merge author checklist
Docs and MetaMask Mobile
Coding
Standards.
if applicable
guidelines).
Not required for external contributors.
Pre-merge reviewer checklist
app, test code being changed).
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.