Skip to content

Commit

Permalink
hotfix: admin accounts data
Browse files Browse the repository at this point in the history
  • Loading branch information
ivopaunov committed Jul 10, 2024
1 parent b1223ee commit fc79a47
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/AdminPanel/Accounts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,15 @@ const AdminAnalytics = () => {
}, [adexServicesRequest])

const data = useMemo(() => {
if (!accounts.length) {
return {
elements: [],
totalDeposits: 0,
totalCampaignsLocked: 0
}
}
// TODO: fix this when multy token
const decimals = accounts[0].balanceToken.decimals
const decimals = accounts[0]?.balanceToken?.decimals
const totalDeposits = parseBigNumTokenAmountToDecimal(
accounts?.reduce((sum, a) => sum + BigInt(a.fundsDeposited.total), 0n),
decimals
Expand Down

0 comments on commit fc79a47

Please sign in to comment.