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

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

This reverts commit b359844dc5.
This commit is contained in:
Dan J Miller 2022-09-19 15:41:48 -02:30 committed by GitHub
parent 17b7b72886
commit 5b917444d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 20 deletions

View File

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

View File

@ -1135,21 +1135,6 @@ export function getIstokenDetectionInactiveOnNonMainnetSupportedNetwork(state) {
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
*