From 99e3721f1391e06b95e441f77b8b2d98ff3a69f3 Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Wed, 14 Sep 2022 13:05:14 -0230 Subject: [PATCH] Ensure that 'tokens found in this account' message is only shown when token detection activated (#15823) --- ui/components/app/asset-list/asset-list.js | 13 +++++-------- ui/selectors/selectors.js | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/ui/components/app/asset-list/asset-list.js b/ui/components/app/asset-list/asset-list.js index a55ed3677..27b8664f6 100644 --- a/ui/components/app/asset-list/asset-list.js +++ b/ui/components/app/asset-list/asset-list.js @@ -11,7 +11,7 @@ import { getShouldShowFiat, getNativeCurrencyImage, getDetectedTokensInCurrentNetwork, - getIstokenDetectionInactiveOnNonMainnetSupportedNetwork, + getDisplayDetectedTokensLink, } from '../../../selectors'; import { getNativeCurrency } from '../../../ducks/metamask/metamask'; import { useCurrencyDisplay } from '../../../hooks/useCurrencyDisplay'; @@ -66,9 +66,7 @@ const AssetList = ({ onClickAsset }) => { const primaryTokenImage = useSelector(getNativeCurrencyImage); const detectedTokens = useSelector(getDetectedTokensInCurrentNetwork) || []; - const istokenDetectionInactiveOnNonMainnetSupportedNetwork = useSelector( - getIstokenDetectionInactiveOnNonMainnetSupportedNetwork, - ); + const displayDetectedTokensLink = useSelector(getDisplayDetectedTokensLink); return ( <> @@ -96,10 +94,9 @@ const AssetList = ({ onClickAsset }) => { }); }} /> - {detectedTokens.length > 0 && - !istokenDetectionInactiveOnNonMainnetSupportedNetwork && ( - - )} + {detectedTokens.length > 0 && displayDetectedTokensLink && ( + + )} 0 ? 0 : 4}>