metamask-extension icon indicating copy to clipboard operation
metamask-extension copied to clipboard

feat: Multichain: Migrate getCurrentChainId to use page context

Open darkwing opened this issue 1 year ago • 1 comments

Description

This PR makes getCurrentChainId return the dapp context chainId when connected to a dapp, falling back to the global chainId when not connected to a dapp.

** TODO **

  • Based on this, we should initialize state.metamask.domains to always have metamask entry of whatever the default chainId is a MetaMask install (Mainnet for prod, Sepolia for dev)

Open in GitHub Codespaces

Related issues

Fixes: https://github.com/MetaMask/metamask-extension/issues/27832

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

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.

darkwing avatar Oct 08 '24 22:10 darkwing