Skip to content

Commit

Permalink
token transfer total is possibly null
Browse files Browse the repository at this point in the history
  • Loading branch information
isstuev authored and tom2drum committed Nov 8, 2024
1 parent a30c0fd commit ab50980
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ui/shared/TokenTransfer/TokenTransferListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const TokenTransferListItem = ({
<TxAdditionalInfo hash={ txHash } isMobile isLoading={ isLoading }/>
) }
</Flex>
{ 'token_id' in total && total.token_id !== null && <NftEntity hash={ token.address } id={ total.token_id } isLoading={ isLoading }/> }
{ total && 'token_id' in total && total.token_id !== null && <NftEntity hash={ token.address } id={ total.token_id } isLoading={ isLoading }/> }
{ showTxInfo && txHash && (
<Flex justifyContent="space-between" alignItems="center" lineHeight="24px" width="100%">
<TxEntity
Expand Down
2 changes: 1 addition & 1 deletion ui/shared/TokenTransfer/TokenTransferTableItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const TokenTransferTableItem = ({
</Flex>
</Td>
<Td>
{ 'token_id' in total && total.token_id !== null && <NftEntity hash={ token.address } id={ total.token_id } isLoading={ isLoading }/> }
{ total && 'token_id' in total && total.token_id !== null && <NftEntity hash={ token.address } id={ total.token_id } isLoading={ isLoading }/> }
</Td>
{ showTxInfo && txHash && (
<Td>
Expand Down
2 changes: 1 addition & 1 deletion ui/token/TokenTransfer/TokenTransferListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const TokenTransferListItem = ({
) }
</Grid>
) }
{ 'token_id' in total && (NFT_TOKEN_TYPE_IDS.includes(token.type)) && total.token_id !== null && (
{ total && 'token_id' in total && (NFT_TOKEN_TYPE_IDS.includes(token.type)) && total.token_id !== null && (
<NftEntity
hash={ token.address }
id={ total.token_id }
Expand Down
2 changes: 1 addition & 1 deletion ui/token/TokenTransfer/TokenTransferTableItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const TokenTransferTableItem = ({
</Td>
{ (NFT_TOKEN_TYPE_IDS.includes(token.type)) && (
<Td>
{ 'token_id' in total && total.token_id !== null ? (
{ total && 'token_id' in total && total.token_id !== null ? (
<NftEntity
hash={ token.address }
id={ total.token_id }
Expand Down
2 changes: 1 addition & 1 deletion ui/tokenTransfers/TokenTransfersListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const TokenTransfersListItem = ({ item, isLoading }: Props) => {
<AddressEntity address={ item.to } isLoading={ isLoading } truncation="constant"/>
</ListItemMobileGrid.Value>

{ 'token_id' in item.total && (NFT_TOKEN_TYPE_IDS.includes(item.token.type)) && item.total.token_id !== null && (
{ item.total && 'token_id' in item.total && (NFT_TOKEN_TYPE_IDS.includes(item.token.type)) && item.total.token_id !== null && (
<>
<ListItemMobileGrid.Label isLoading={ isLoading }>Token ID</ListItemMobileGrid.Label>
<ListItemMobileGrid.Value overflow="hidden">
Expand Down
2 changes: 1 addition & 1 deletion ui/tokenTransfers/TokenTransfersTableItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const TokenTransferTableItem = ({ item, isLoading }: Props) => {
/>
</Td>
<Td>
{ 'token_id' in item.total && (NFT_TOKEN_TYPE_IDS.includes(item.token.type)) && item.total.token_id !== null ? (
{ item.total && 'token_id' in item.total && (NFT_TOKEN_TYPE_IDS.includes(item.token.type)) && item.total.token_id !== null ? (
<NftEntity
hash={ item.token.address }
id={ item.total.token_id }
Expand Down

0 comments on commit ab50980

Please sign in to comment.