From 2819ffc314301526686d982aa14460575a8bc3a4 Mon Sep 17 00:00:00 2001 From: nikoferro Date: Fri, 26 May 2023 15:45:29 +0200 Subject: [PATCH] bugfix: fix for swaps button displaying on unsupported networks --- app/components/Views/Asset/index.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/app/components/Views/Asset/index.js b/app/components/Views/Asset/index.js index bd19c20550c..a32f0debdbc 100644 --- a/app/components/Views/Asset/index.js +++ b/app/components/Views/Asset/index.js @@ -470,6 +470,15 @@ class Asset extends PureComponent { }); }; + const displaySwapsButton = + isSwapsFeatureLive && + isNetworkAllowed && + isAssetAllowed && + AppConstants.SWAPS.ACTIVE; + + const displayBuyButton = + asset.isETH && this.props.isNetworkBuyNativeTokenSupported; + return ( {loading ? ( @@ -496,9 +505,9 @@ class Asset extends PureComponent { onScrollThroughContent={this.onScrollThroughContent} /> )} - {!asset.balanceError && ( + {!asset.balanceError && (displayBuyButton || displaySwapsButton) && ( - {asset.isETH && this.props.isNetworkBuyNativeTokenSupported && ( + {displayBuyButton && (