1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 09:57:02 +01:00

UX: Multichain: Don't filter out custom mainnet RPCs (#19150)

This commit is contained in:
David Walsh 2023-05-17 12:26:15 -05:00 committed by GitHub
parent 556d3d82cc
commit 577e4cba0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -120,7 +120,8 @@
"networkConfigurations": { "networkConfigurations": {
"testNetworkConfigurationId": { "testNetworkConfigurationId": {
"rpcUrl": "https://testrpc.com", "rpcUrl": "https://testrpc.com",
"chainId": "0x1" "chainId": "0x1",
"nickname": "Custom Mainnet RPC"
} }
}, },
"keyrings": [ "keyrings": [

View File

@ -76,7 +76,7 @@ export const NetworkListMenu = ({ onClose }) => {
> >
<> <>
<Box className="multichain-network-list-menu" ref={networkListRef}> <Box className="multichain-network-list-menu" ref={networkListRef}>
{networks.map((network) => { {networks.map((network, index) => {
const isCurrentNetwork = currentChainId === network.chainId; const isCurrentNetwork = currentChainId === network.chainId;
const canDeleteNetwork = const canDeleteNetwork =
!isCurrentNetwork && !isCurrentNetwork &&
@ -86,7 +86,7 @@ export const NetworkListMenu = ({ onClose }) => {
<NetworkListItem <NetworkListItem
name={network.nickname} name={network.nickname}
iconSrc={network?.rpcPrefs?.imageUrl} iconSrc={network?.rpcPrefs?.imageUrl}
key={network.id || network.chainId} key={`${network.id || network.chainId}-${index}`}
selected={isCurrentNetwork} selected={isCurrentNetwork}
onClick={async () => { onClick={async () => {
dispatch(toggleNetworkMenu()); dispatch(toggleNetworkMenu());

View File

@ -1189,7 +1189,6 @@ export function getAllNetworks(state) {
({ chainId }) => ({ chainId }) =>
![ ![
CHAIN_IDS.LOCALHOST, CHAIN_IDS.LOCALHOST,
CHAIN_IDS.MAINNET,
// Linea gets added as a custom network configuration so // Linea gets added as a custom network configuration so
// we must ignore it here to display in test networks // we must ignore it here to display in test networks
CHAIN_IDS.LINEA_TESTNET, CHAIN_IDS.LINEA_TESTNET,