Skip to content

Commit

Permalink
fix: asset balance regression (#7877)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xApotheosis authored Oct 3, 2024
1 parent 9b5db4f commit ba20de3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/Equity/Equity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { useMemo } from 'react'
import { useTranslate } from 'react-polyglot'
import { useSelector } from 'react-redux'
import { Amount } from 'components/Amount/Amount'
import { useWallet } from 'hooks/useWallet/useWallet'
import type { LpId, OpportunityId } from 'state/slices/opportunitiesSlice/types'
import { AssetEquityType } from 'state/slices/portfolioSlice/portfolioSliceCommon'
import {
Expand Down Expand Up @@ -44,6 +45,9 @@ export const Equity = ({ assetId, accountId }: EquityProps) => {
const portfolioLoading = useSelector(selectIsPortfolioLoading)
const opportunitiesLoading = useAppSelector(selectOpportunityApiPending)
const isLoading = portfolioLoading || opportunitiesLoading
const {
state: { isConnected },
} = useWallet()
const assets = useAppSelector(selectAssets)
const asset = assets[assetId]
const borderColor = useColorModeValue('blackAlpha.50', 'whiteAlpha.50')
Expand Down Expand Up @@ -142,7 +146,7 @@ export const Equity = ({ assetId, accountId }: EquityProps) => {
[borderColor],
)

if (!asset || !accountId) return null
if (!asset || !isConnected) return null

return (
<Card variant='dashboard'>
Expand Down

0 comments on commit ba20de3

Please sign in to comment.