diff --git a/ui/components/multichain/network-list-menu/network-list-menu.js b/ui/components/multichain/network-list-menu/network-list-menu.js index 37bf7482d60f..9fd49b9bdb4f 100644 --- a/ui/components/multichain/network-list-menu/network-list-menu.js +++ b/ui/components/multichain/network-list-menu/network-list-menu.js @@ -38,7 +38,6 @@ import { Box, Text, TextFieldSearch, - Text, } from '../../component-library'; import { ADD_POPULAR_CUSTOM_NETWORK } from '../../../helpers/constants/routes'; import { getEnvironmentType } from '../../../../app/scripts/lib/util'; @@ -81,6 +80,8 @@ export const NetworkListMenu = ({ onClose }) => { const lineaMainnetReleased = useSelector(isLineaMainnetNetworkReleased); + const showSearch = nonTestNetworks.length > 3; + useEffect(() => { if (currentlyOnTestNetwork) { dispatch(setShowTestNetworks(currentlyOnTestNetwork)); @@ -126,7 +127,7 @@ export const NetworkListMenu = ({ onClose }) => { iconSrc={network?.rpcPrefs?.imageUrl} key={`${network.id || network.chainId}-${index}`} selected={isCurrentNetwork} - focus={isCurrentNetwork && !isSearching} + focus={isCurrentNetwork && !showSearch} onClick={() => { dispatch(toggleNetworkMenu()); if (network.providerType) { @@ -191,7 +192,7 @@ export const NetworkListMenu = ({ onClose }) => { {t('networkMenuHeading')} <> - {nonTestNetworks.length > 3 ? ( + {showSearch ? (