Skip to content
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

Merged
merged 2 commits into from
Jan 15, 2025

Conversation

amitabh94
Copy link
Contributor

@amitabh94 amitabh94 commented Jan 14, 2025

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

  1. Open the app and navigate to home page and select Portfolio View
  2. Change the Network to Linea
  3. Click on Earn button next to Ethereum in Portfolio View
  4. It should change the network to mainnet and then navigate to staking UI

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

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the
    app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described
    in the ticket it closes and includes the necessary testing evidence such
    as recordings and or screenshots.

Copy link
Contributor

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.

@amitabh94 amitabh94 changed the title fix: Enable Earn CTA navigation on unsupported networks fix: enable earn button navigation on unsupported networks Jan 14, 2025
@amitabh94 amitabh94 force-pushed the STAKE-916--earn-link-unresponsive branch from 50fb2ff to 34d989a Compare January 15, 2025 00:45
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.
@amitabh94 amitabh94 force-pushed the STAKE-916--earn-link-unresponsive branch from 34d989a to db2fb3c Compare January 15, 2025 14:42
@amitabh94 amitabh94 marked this pull request as ready for review January 15, 2025 14:49
@amitabh94 amitabh94 requested a review from a team as a code owner January 15, 2025 14:49
@amitabh94 amitabh94 enabled auto-merge January 15, 2025 14:49
@amitabh94 amitabh94 added the Run Smoke E2E Triggers smoke e2e on Bitrise label Jan 15, 2025
Copy link
Contributor

https://bitrise.io/ Bitrise

🔄🔄🔄 pr_smoke_e2e_pipeline started on Bitrise...🔄🔄🔄

Commit hash: db2fb3c
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/032c7873-e251-44ea-bb72-7931135119d6

Note

  • This comment will auto-update when build completes
  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@amitabh94 amitabh94 requested a review from a team as a code owner January 15, 2025 15:17
@amitabh94 amitabh94 added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Jan 15, 2025
Copy link
Contributor

github-actions bot commented Jan 15, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 1971ee3
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/82fe4be3-9d20-47f9-972e-0f0603b86be9

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 59.82%. Comparing base (faf5340) to head (1971ee3).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...mponents/UI/Stake/components/StakeButton/index.tsx 40.00% 2 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@Matt561 Matt561 left a 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!

@amitabh94 amitabh94 added this pull request to the merge queue Jan 15, 2025
Merged via the queue into main with commit 9b0b6e7 Jan 15, 2025
40 of 41 checks passed
@amitabh94 amitabh94 deleted the STAKE-916--earn-link-unresponsive branch January 15, 2025 16:57
@github-actions github-actions bot locked and limited conversation to collaborators Jan 15, 2025
@metamaskbot metamaskbot added the release-7.39.0 Issue or pull request that will be included in release 7.39.0 label Jan 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-7.39.0 Issue or pull request that will be included in release 7.39.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-stake
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants