diff --git a/src/data/queries/ibc.ts b/src/data/queries/ibc.ts index 4942bed13..2e371e1d0 100644 --- a/src/data/queries/ibc.ts +++ b/src/data/queries/ibc.ts @@ -97,12 +97,13 @@ export const useIBCBaseDenoms = (data: { denom: Denom; chainID: string }[]) => { const channels = [] for (let i = 0; i < paths.length; i += 2) { - if (!network[chainID]?.lcd) return + const chain = chains[0] + if (!network[chain]?.lcd) return const [port, channel] = [paths[i], paths[i + 1]] channels.unshift({ port, channel }) const res = await axios.get( `/ibc/core/channel/v1/channels/${channel}/ports/${port}/client_state`, - { baseURL: network[chainID].lcd } + { baseURL: network[chain].lcd } ) chains.unshift(res?.data?.identified_client_state.client_state.chain_id) } @@ -132,8 +133,7 @@ export const useIBCBaseDenoms = (data: { denom: Denom; chainID: string }[]) => { const updatedDenomTraces = queryResults.reduce((acc, result) => { if (result.data) { - const { ibcDenom, ...rest } = result.data - acc[ibcDenom] = { data: rest, timestamp: Date.now() } + acc[result.data?.ibcDenom] = { data: result.data, timestamp: Date.now() } } return acc }, {} as Record) diff --git a/src/data/settings/Theme.ts b/src/data/settings/Theme.ts index 38251c4f3..1f6f8ace6 100644 --- a/src/data/settings/Theme.ts +++ b/src/data/settings/Theme.ts @@ -1,15 +1,12 @@ import { useCallback } from "react" import { atom, useRecoilState, useRecoilValue } from "recoil" import BigNumber from "bignumber.js" -import { always } from "ramda" import themes, { Theme } from "styles/themes/themes" import { DefaultTheme, SettingKey } from "utils/localStorage" import { //getLocalSetting, setLocalSetting, } from "utils/localStorage" -import { debug } from "utils/env" -import { useAddress, useChainID, useNetworkName } from "data/wallet" export const themeNameState = atom({ key: "themeName", diff --git a/src/extension/App.tsx b/src/extension/App.tsx index bdf0881a7..414eba8a2 100644 --- a/src/extension/App.tsx +++ b/src/extension/App.tsx @@ -39,7 +39,7 @@ import Auth from "./auth/Auth" import UpgradeWalletButton from "app/sections/UpgradeWalletButton" import { Tooltip } from "@terra-money/station-ui" import { useTranslation } from "react-i18next" -import SwapContext, { SwapProvider } from "txs/swap/SwapContext" +import SwapContext from "txs/swap/SwapContext" const App = () => { const { networks } = useNetworks() diff --git a/src/extension/RequestContainer.tsx b/src/extension/RequestContainer.tsx index afa110a2b..2e3a8ac9a 100644 --- a/src/extension/RequestContainer.tsx +++ b/src/extension/RequestContainer.tsx @@ -51,13 +51,13 @@ const RequestContainer = ({ children }: PropsWithChildren<{}>) => { const [chain, setChain] = useState() const [tx, setTx] = useState() const [network, setNetwork] = useState() - const [isLoading, setLoading] = useState(true) + const [isLoading, setLoading] = useState(!!browser.storage?.local) const parseTx = useParseTx() const networks = useNetwork() const defaultChainID = useChainID() useEffect(() => { - setLoading(true) + setLoading(!!browser.storage?.local) // Requests from storage // except for that is already success or failure browser.storage?.local diff --git a/src/extension/utils.ts b/src/extension/utils.ts index 356cc6162..57d36cecb 100644 --- a/src/extension/utils.ts +++ b/src/extension/utils.ts @@ -6,7 +6,7 @@ import { SignatureV2, Tx, } from "@terra-money/feather.js" -import { useAllNetworks, useChainID, useNetwork } from "data/wallet" +import { useAllNetworks, useChainID } from "data/wallet" import { isNil } from "ramda" import browser from "webextension-polyfill" diff --git a/src/pages/wallet/SendPage/SendTx.tsx b/src/pages/wallet/SendPage/SendTx.tsx index fbec6083b..b05d0ea3a 100644 --- a/src/pages/wallet/SendPage/SendTx.tsx +++ b/src/pages/wallet/SendPage/SendTx.tsx @@ -1,4 +1,4 @@ -import { Routes, Route, useLocation, useNavigate } from "react-router-dom" +import { Routes, Route, useLocation } from "react-router-dom" import { useTranslation } from "react-i18next" import Address from "./Address" import Chain from "./Chain" diff --git a/src/pages/wallet/SendPage/Submit.tsx b/src/pages/wallet/SendPage/Submit.tsx index 02e0164ea..23cf4ad08 100644 --- a/src/pages/wallet/SendPage/Submit.tsx +++ b/src/pages/wallet/SendPage/Submit.tsx @@ -68,7 +68,6 @@ const Submit = () => { ) const originChain = useMemo(() => ibcData?.chainIDs?.[0], [ibcData]) - console.log("formState.isValid", formState.errors) const showIBCWarning = useMemo(() => { return ( diff --git a/src/utils/chain.ts b/src/utils/chain.ts index 43cda2ff1..3dd084377 100644 --- a/src/utils/chain.ts +++ b/src/utils/chain.ts @@ -1,6 +1,5 @@ import { AccAddress } from "@terra-money/feather.js" import { ChainID } from "types/network" -import { bech32 } from "bech32" export const isTerraChain = (chainID: ChainID) => { return chainID?.startsWith("phoenix-") || chainID?.startsWith("pisco-")