Skip to content

Commit

Permalink
fix: update get list selected chain
Browse files Browse the repository at this point in the history
  • Loading branch information
quangdz1704 committed Dec 11, 2024
1 parent add6a00 commit 68ea634
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"url": "https://oraidex.io",
"url": "https://app.oraidex.io",
"name": "OraiDex",
"iconUrl": "https://oraidex.io/favicon.svg"
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export default function InputSwap({
impactWarning
}: InputSwapProps) {
let chainInfo = chainInfosWithIcon.find((chain) => chain.chainId === selectChain);
console.log({ selectChain });

if (!chainInfo) {
chainInfo = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<>
{/* <div className={cx('selectChainWrap', isSelectToken ? 'active' : '')}> */}
Expand All @@ -69,13 +73,7 @@ export default function SelectChain({

<div className={styles.selectChainList}>
<div className={styles.selectChainItems}>
{[...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)
Expand Down
10 changes: 5 additions & 5 deletions src/pages/UniversalSwap/Swap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 68ea634

Please sign in to comment.