Skip to content

Commit

Permalink
Merge branch 'sprint-staging-0318'
Browse files Browse the repository at this point in the history
  • Loading branch information
mwmerz committed Apr 18, 2024
2 parents 6dec2d6 + e02356e commit af7dd3c
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/data/queries/ibc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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<string, { data: any; timestamp: number }>)
Expand Down
3 changes: 0 additions & 3 deletions src/data/settings/Theme.ts
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/extension/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions src/extension/RequestContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ const RequestContainer = ({ children }: PropsWithChildren<{}>) => {
const [chain, setChain] = useState<SuggestChainRequest>()
const [tx, setTx] = useState<TxRequest | SignBytesRequest>()
const [network, setNetwork] = useState<SwitchNetworkRequest>()
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
Expand Down
2 changes: 1 addition & 1 deletion src/extension/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion src/pages/wallet/SendPage/SendTx.tsx
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
1 change: 0 additions & 1 deletion src/pages/wallet/SendPage/Submit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ const Submit = () => {
)

const originChain = useMemo(() => ibcData?.chainIDs?.[0], [ibcData])
console.log("formState.isValid", formState.errors)

const showIBCWarning = useMemo(() => {
return (
Expand Down
1 change: 0 additions & 1 deletion src/utils/chain.ts
Original file line number Diff line number Diff line change
@@ -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-")
Expand Down

0 comments on commit af7dd3c

Please sign in to comment.