Skip to content

Commit

Permalink
Fixed issue loading wallet token card lazy info.
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSaso committed Sep 5, 2023
1 parent 3228cfa commit 6f41444
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/stateful/components/WalletTokenLine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import {
useCachedLoading,
} from '@dao-dao/stateless'
import { TokenCardInfo, TokenLineProps } from '@dao-dao/types'
import { getDisplayNameForChainId } from '@dao-dao/utils'
import {
getDisplayNameForChainId,
transformBech32Address,
} from '@dao-dao/utils'

import { useWallet } from '../hooks/useWallet'
import { tokenCardLazyInfoSelector } from '../recoil'
Expand All @@ -12,14 +15,13 @@ import { WalletTokenCard } from './WalletTokenCard'
export const WalletTokenLine = <T extends TokenCardInfo>(
props: Omit<TokenLineProps<T>, 'TokenCard'>
) => {
const { address: walletAddress } = useWallet({
chainId: props.token.chainId,
})
// In case
const { address: walletAddress } = useWallet()

const lazyInfo = useCachedLoading(
walletAddress
? tokenCardLazyInfoSelector({
owner: walletAddress,
owner: transformBech32Address(walletAddress, props.token.chainId),
token: props.token,
unstakedBalance: props.unstakedBalance,
})
Expand Down

0 comments on commit 6f41444

Please sign in to comment.