From 63b261c9ecbff68aeb5489472b602521b1bffbc7 Mon Sep 17 00:00:00 2001 From: Alessandro Candeago <54709706+alecande11@users.noreply.github.com> Date: Wed, 7 Jun 2023 20:35:23 +0200 Subject: [PATCH] Fix tokens that contains : --- src/app/InitBankBalance.tsx | 3 ++- src/pages/wallet/AssetList.tsx | 2 +- src/pages/wallet/AssetPage.tsx | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/app/InitBankBalance.tsx b/src/app/InitBankBalance.tsx index 55a3bf1f5..a398f09c4 100644 --- a/src/app/InitBankBalance.tsx +++ b/src/app/InitBankBalance.tsx @@ -30,7 +30,8 @@ const InitBankBalance = ({ children }: PropsWithChildren<{}>) => { ) native.list.forEach(({ id }) => { - const [chain, denom] = id.split(":") + const [chain, ...denomData] = id.split(":") + const denom = denomData.join(":") if ( !bankBalance.find( (balance) => balance.denom === denom && balance.chain === chain diff --git a/src/pages/wallet/AssetList.tsx b/src/pages/wallet/AssetList.tsx index 359cee6fc..424643636 100644 --- a/src/pages/wallet/AssetList.tsx +++ b/src/pages/wallet/AssetList.tsx @@ -77,7 +77,7 @@ const AssetList = () => { // @ts-expect-error unknownIBCDenoms[denom]?.chainID ?? data.chainID ?? chain, data.token, - ].join(":") + ].join("*") if (acc[key]) { acc[key].balance = `${ diff --git a/src/pages/wallet/AssetPage.tsx b/src/pages/wallet/AssetPage.tsx index cbca3c45a..62440fbde 100644 --- a/src/pages/wallet/AssetPage.tsx +++ b/src/pages/wallet/AssetPage.tsx @@ -21,8 +21,8 @@ const AssetPage = () => { const { t } = useTranslation() const { setRoute, route } = useWalletRoute() const routeDenom = route.path === Path.coin ? route.denom ?? "uluna" : "uluna" - const [chain, denom] = routeDenom.includes(":") - ? routeDenom.split(":") + const [chain, denom] = routeDenom.includes("*") + ? routeDenom.split("*") : [undefined, routeDenom] const { token, symbol, icon, decimals } = readNativeDenom(denom, chain)