-
Notifications
You must be signed in to change notification settings - Fork 5k
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: Multichain: Migrate getCurrentChainId to use page context #27710
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. |
38d67a3
to
d6c59e9
Compare
ui/selectors/selectors.js
Outdated
// TODO: Fallback chainID should be from Settings, NOT getProviderConfig | ||
const FALLBACK_CHAIN_ID = CHAIN_IDS.MAINNET; | ||
|
||
if (state.metamask.domains === undefined) { |
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.
Worth double-checking why this is undefined, this doesn't seem like it should be possible
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.
At a glance this doesn't seem possible. Maybe caused by a bad fixture.
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 think this is a possibility when the autoswitch toggle is off 🤔
516919e
to
94f4e23
Compare
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 **
state.metamask.domains
to always havemetamask
entry of whatever the default chainId is a MetaMask install (Mainnet for prod, Sepolia for dev)Related issues
Fixes: #27832
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist