-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
chore: remove MM_CHAIN_PERMISSIONS flag #16142
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
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. |
|
|
@@ -319,7 +308,7 @@ export async function switchToNetwork({ | |||
} | |||
} | |||
|
|||
if (!shouldShowRequestModal && !ethChainIds.includes(chainId)) { | |||
if (!shouldShowRequestModal && !ethChainIds?.includes(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.
Why is the optional chaining required now?
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.
➕
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.
ethChainIds
can be either an array or undefined and I think previously the flag was preventing that condition to be reached when it was undefined. After the change, tests broke when entering that condition.
Description
Enables the behaviour gated by
MM_CHAIN_PERMISSIONS
feature flag to be available by default. Dapps requesting network changes viawallet_addEthereumChain
orwallet_switchEthereumChain
will prompt the user to add permission to access the specified chain IDs and, if granted, subsequentwallet_switchEthereumChain
requests made to that chainId will not require user confirmation.Related issues
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/5026
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist