Skip to content

Commit

Permalink
fix: price undefined (#423)
Browse files Browse the repository at this point in the history
* fix: price

* ref: using ?? operator
  • Loading branch information
MrX-SNX authored Aug 29, 2024
1 parent c581ceb commit bd465c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions liquidity/ui/src/components/Pools/PoolCards/PoolCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const PoolCard = ({
const vaultTVL = collateralTypes?.reduce((acc, type) => {
const price = wei(
collateralPrices?.find((price) => price.symbol.toUpperCase() === type.symbol.toUpperCase())
?.price || 0
?.price ?? 0
);
const amount = wei(type.collateralDeposited, Number(type.decimals), true);
const value = price.mul(amount);
Expand Down Expand Up @@ -274,7 +274,7 @@ export const PoolCard = ({
const price = wei(
collateralPrices?.find(
(price) => price.symbol.toUpperCase() === type.symbol.toUpperCase()
)?.price
)?.price ?? 0
);

const collateralApr = apr.collateralAprs.find(
Expand Down

0 comments on commit bd465c0

Please sign in to comment.