From 68ea634f29a4746f8e58d97ac02ad98cf2b5e9e2 Mon Sep 17 00:00:00 2001 From: quangdz1704 Date: Wed, 11 Dec 2024 15:07:40 +0700 Subject: [PATCH] fix: update get list selected chain --- public/manifest.json | 2 +- .../Swap/components/InputSwap/InputSwap.tsx | 1 - .../Swap/components/SelectChain/SelectChain.tsx | 12 +++++------- src/pages/UniversalSwap/Swap/index.tsx | 10 +++++----- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/public/manifest.json b/public/manifest.json index 2005f7544..8aff2ecc1 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -1,5 +1,5 @@ { - "url": "https://oraidex.io", + "url": "https://app.oraidex.io", "name": "OraiDex", "iconUrl": "https://oraidex.io/favicon.svg" } diff --git a/src/pages/UniversalSwap/Swap/components/InputSwap/InputSwap.tsx b/src/pages/UniversalSwap/Swap/components/InputSwap/InputSwap.tsx index cc132fd16..aee255acd 100644 --- a/src/pages/UniversalSwap/Swap/components/InputSwap/InputSwap.tsx +++ b/src/pages/UniversalSwap/Swap/components/InputSwap/InputSwap.tsx @@ -55,7 +55,6 @@ export default function InputSwap({ impactWarning }: InputSwapProps) { let chainInfo = chainInfosWithIcon.find((chain) => chain.chainId === selectChain); - console.log({ selectChain }); if (!chainInfo) { chainInfo = { diff --git a/src/pages/UniversalSwap/Swap/components/SelectChain/SelectChain.tsx b/src/pages/UniversalSwap/Swap/components/SelectChain/SelectChain.tsx index d15e3001e..e054a7709 100644 --- a/src/pages/UniversalSwap/Swap/components/SelectChain/SelectChain.tsx +++ b/src/pages/UniversalSwap/Swap/components/SelectChain/SelectChain.tsx @@ -44,6 +44,10 @@ export default function SelectChain({ return acc + totalUsd; }, 0); + const listChains = [...networks] + .filter((net) => !isAllowChainId(net.chainId) && (!filterChainId.length || filterChainId.includes(net.chainId))) + .filter((n) => !isMaintainBridge || (isMaintainBridge && n.networkType === 'cosmos' && n.chainId !== 'noble-1')); + return ( <> {/*
*/} @@ -69,13 +73,7 @@ export default function SelectChain({
- {[...networks] - .filter( - (net) => !isAllowChainId(net.chainId) && (!filterChainId.length || filterChainId.includes(net.chainId)) - ) - .filter( - (n) => !isMaintainBridge || (isMaintainBridge && n.networkType === 'cosmos' && n.chainId !== 'noble-1') - ) + {listChains .map((n) => { const subAmounts = Object.fromEntries( Object.entries(amounts).filter(([denom]) => tokenMap[denom] && tokenMap[denom].chainId === n.chainId) diff --git a/src/pages/UniversalSwap/Swap/index.tsx b/src/pages/UniversalSwap/Swap/index.tsx index f78bd01b1..641444cc9 100644 --- a/src/pages/UniversalSwap/Swap/index.tsx +++ b/src/pages/UniversalSwap/Swap/index.tsx @@ -446,16 +446,16 @@ const SwapComponent: React.FC<{ setCoe(coeff); }; - const unSupportSimulateToken = ['bnb', 'bep20_wbnb', 'eth', TON_ORAICHAIN_DENOM]; + const unSupportSimulateToken = ['bnb', 'bep20_wbnb', 'eth']; const supportedChainFunc = () => { if (unSupportSimulateToken.includes(originalFromToken?.denom)) { return ['Oraichain']; } - const isOraichainDenom = [originalFromToken.denom, originalToToken.denom].includes(TON_ORAICHAIN_DENOM); - if (isOraichainDenom) { - return networks.filter((chainInfo) => chainInfo.networkType === 'cosmos').map((chain) => chain.chainId); - } + // const isOraichainDenom = [originalFromToken.denom, originalToToken.denom].includes(TON_ORAICHAIN_DENOM); + // if (isOraichainDenom) { + // return networks.filter((chainInfo) => chainInfo.networkType === 'cosmos').map((chain) => chain.chainId); + // } if (originalFromToken.chainId === 'injective-1') { return networks.filter((chainInfo) => chainInfo.chainId === 'Oraichain').map((chain) => chain.chainId);