mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Revert "Ensure that 'tokens found in this account' message is only shown when token detection activated (#15823)" (#15879)
This reverts commit b359844dc550e2c97e922b2008185b646e7caa04.
This commit is contained in:
parent
1bbeb80dff
commit
341d4de8da
@ -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,9 +96,10 @@ const AssetList = ({ onClickAsset }) => {
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{detectedTokens.length > 0 && displayDetectedTokensLink && (
|
{detectedTokens.length > 0 &&
|
||||||
<DetectedTokensLink setShowDetectedTokens={setShowDetectedTokens} />
|
!istokenDetectionInactiveOnNonMainnetSupportedNetwork && (
|
||||||
)}
|
<DetectedTokensLink setShowDetectedTokens={setShowDetectedTokens} />
|
||||||
|
)}
|
||||||
<Box marginTop={detectedTokens.length > 0 ? 0 : 4}>
|
<Box marginTop={detectedTokens.length > 0 ? 0 : 4}>
|
||||||
<Box justifyContent={JUSTIFY_CONTENT.CENTER}>
|
<Box justifyContent={JUSTIFY_CONTENT.CENTER}>
|
||||||
<Typography
|
<Typography
|
||||||
|
@ -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…
x
Reference in New Issue
Block a user