Skip to content

Commit

Permalink
When total supply is not defined for a token, show undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
csillag committed Jul 10, 2023
1 parent 3367916 commit 3a140b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/pages/TokenDashboardPage/TokenSupplyCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ export const TokenSupplyCard: FC = () => {

const { isLoading, token, isFetched } = useTokenInfo(scope, address)

const supplyString = token?.total_supply

return (
<SnapshotCard
title={t('tokens.totalSupply')}
Expand All @@ -40,7 +38,9 @@ export const TokenSupplyCard: FC = () => {
width: '100%',
}}
>
{!supplyString ? t('common.missing') : t('tokens.totalSupplyValue', { value: supplyString })}
{token.total_supply
? t('tokens.totalSupplyValue', { value: token.total_supply })
: t('common.undefined')}
</Typography>
)
)}
Expand Down
1 change: 1 addition & 0 deletions src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"txnFee": "Txn Fee",
"type": "Type",
"quantity": "Quantity",
"undefined": "Undefined",
"unknown": "Unknown",
"value": "Value",
"valueInToken": "{{value}} {{ticker}}",
Expand Down

0 comments on commit 3a140b5

Please sign in to comment.