1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-22 17:33:23 +01:00

UX: Cleanup of NetworkListMenu properties (#20304)

This commit is contained in:
David Walsh 2023-08-01 13:17:48 -05:00 committed by GitHub
parent 24ca518315
commit 7ca418de1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -105,7 +105,7 @@ export const NetworkListMenu = ({ onClose }) => {
}
const generateMenuItems = (desiredNetworks) => {
return desiredNetworks.map((network, index) => {
return desiredNetworks.map((network) => {
if (!lineaMainnetReleased && network.providerType === 'linea-mainnet') {
return null;
}
@ -117,7 +117,7 @@ export const NetworkListMenu = ({ onClose }) => {
<NetworkListItem
name={network.nickname}
iconSrc={network?.rpcPrefs?.imageUrl}
key={`${network.id || network.chainId}-${index}`}
key={network.id}
selected={isCurrentNetwork}
focus={isCurrentNetwork && !showSearch}
onClick={() => {
@ -134,7 +134,7 @@ export const NetworkListMenu = ({ onClose }) => {
location: 'Network Menu',
chain_id: currentChainId,
from_network: currentChainId,
to_network: network.id || network.chainId,
to_network: network.chainId,
},
});
}}
@ -145,7 +145,7 @@ export const NetworkListMenu = ({ onClose }) => {
dispatch(
showModal({
name: 'CONFIRM_DELETE_NETWORK',
target: network.id || network.chainId,
target: network.id,
onConfirm: () => undefined,
}),
);