Revert "Ensure that 'tokens found in this account' message is only shown when token detection activated (#15823)" (#15879)

This reverts commit b359844dc5.
feature/default_network_editable
Dan J Miller 2 years ago committed by PeterYinusa
parent 1bbeb80dff
commit 341d4de8da
  1. 9
      ui/components/app/asset-list/asset-list.js
  2. 15
      ui/selectors/selectors.js

@ -11,7 +11,7 @@ import {
getShouldShowFiat, getShouldShowFiat,
getNativeCurrencyImage, getNativeCurrencyImage,
getDetectedTokensInCurrentNetwork, getDetectedTokensInCurrentNetwork,
getDisplayDetectedTokensLink, getIstokenDetectionInactiveOnNonMainnetSupportedNetwork,
} from '../../../selectors'; } from '../../../selectors';
import { getNativeCurrency } from '../../../ducks/metamask/metamask'; import { getNativeCurrency } from '../../../ducks/metamask/metamask';
import { useCurrencyDisplay } from '../../../hooks/useCurrencyDisplay'; import { useCurrencyDisplay } from '../../../hooks/useCurrencyDisplay';
@ -66,7 +66,9 @@ const AssetList = ({ onClickAsset }) => {
const primaryTokenImage = useSelector(getNativeCurrencyImage); const primaryTokenImage = useSelector(getNativeCurrencyImage);
const detectedTokens = useSelector(getDetectedTokensInCurrentNetwork) || []; const detectedTokens = useSelector(getDetectedTokensInCurrentNetwork) || [];
const displayDetectedTokensLink = useSelector(getDisplayDetectedTokensLink); const istokenDetectionInactiveOnNonMainnetSupportedNetwork = useSelector(
getIstokenDetectionInactiveOnNonMainnetSupportedNetwork,
);
return ( return (
<> <>
@ -94,7 +96,8 @@ const AssetList = ({ onClickAsset }) => {
}); });
}} }}
/> />
{detectedTokens.length > 0 && displayDetectedTokensLink && ( {detectedTokens.length > 0 &&
!istokenDetectionInactiveOnNonMainnetSupportedNetwork && (
<DetectedTokensLink setShowDetectedTokens={setShowDetectedTokens} /> <DetectedTokensLink setShowDetectedTokens={setShowDetectedTokens} />
)} )}
<Box marginTop={detectedTokens.length > 0 ? 0 : 4}> <Box marginTop={detectedTokens.length > 0 ? 0 : 4}>

@ -1128,21 +1128,6 @@ export function getIstokenDetectionInactiveOnNonMainnetSupportedNetwork(state) {
return isDynamicTokenListAvailable && !useTokenDetection && !isMainnet; return isDynamicTokenListAvailable && !useTokenDetection && !isMainnet;
} }
/**
* To check if the token detection is ON and either a dynamic list is available
* or the user is on mainnet
*
* @param {*} state
* @returns Boolean
*/
export function getDisplayDetectedTokensLink(state) {
const useTokenDetection = getUseTokenDetection(state);
const isMainnet = getIsMainnet(state);
const isDynamicTokenListAvailable = getIsDynamicTokenListAvailable(state);
return (isDynamicTokenListAvailable || isMainnet) && useTokenDetection;
}
/** /**
* To get the `customNetworkListEnabled` value which determines whether we use the custom network list * To get the `customNetworkListEnabled` value which determines whether we use the custom network list
* *

Loading…
Cancel
Save