Skip to content

Commit

Permalink
fix: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
sahar-fehri committed Dec 11, 2024
1 parent 47a4718 commit 90fe809
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions app/components/UI/Swaps/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,13 @@ if (__DEV__) {
allowedChainIds.push(...allowedTestnetChainIds);
}

export function isSwapsAllowed(chainId, tokenChainId = undefined) {
export function isSwapsAllowed(chainId) {
if (!AppConstants.SWAPS.ACTIVE) {
return false;
}
if (!AppConstants.SWAPS.ONLY_MAINNET) {
allowedChainIds.push(SWAPS_TESTNET_CHAIN_ID);
}
if (isPortfolioViewEnabled() && tokenChainId) {
return allowedChainIds.includes(tokenChainId);
}
return allowedChainIds.includes(chainId);
}

Expand Down
2 changes: 1 addition & 1 deletion app/components/Views/Asset/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ class Asset extends PureComponent {
const styles = createStyles(colors);
const asset = navigation && params;
const isSwapsFeatureLive = this.props.swapsIsLive;
const isNetworkAllowed = isSwapsAllowed(chainId, asset.chainId);
const isNetworkAllowed = isSwapsAllowed(asset.chainId);

const isAssetAllowed =
asset.isETH || asset.address?.toLowerCase() in this.props.swapsTokens;
Expand Down

0 comments on commit 90fe809

Please sign in to comment.