Skip to content

Commit

Permalink
Merge pull request #931 from Magickbase/fix/page-display-account-is-u…
Browse files Browse the repository at this point in the history
…ndefined
  • Loading branch information
Keith-CY authored Apr 27, 2023
2 parents 291b2d8 + 71a979f commit 12c60b4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
18 changes: 9 additions & 9 deletions components/MultiTokenActivityList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,24 +124,24 @@ const ActivityList: React.FC<
<tbody>
{transfers?.metadata.total_count ? (
transfers.entries.map(item => {
const method = item.transaction.method_name || item.transaction.method_id
const method = item.transaction?.method_name || item.transaction?.method_id
const fromBitAlias = item.from_account?.bit_alias
const toBitAlias = item.to_account?.bit_alias

const token_ids = Array.isArray(item.token_ids) ? item.token_ids : [item.token_id]
const amounts = Array.isArray(item.amounts) ? item.amounts : [item.amount]

return (
<tr key={item.transaction.eth_hash + item.log_index}>
<tr key={item.transaction?.eth_hash + item.log_index}>
<td>
<div className={styles.hash}>
<Tooltip title={item.transaction.eth_hash} placement="top">
<Tooltip title={item.transaction?.eth_hash} placement="top">
<span>
<NextLink href={`/tx/${item.transaction.eth_hash}`}>
<a className="mono-font">{`${item.transaction.eth_hash.slice(
<NextLink href={`/tx/${item.transaction?.eth_hash}`}>
<a className="mono-font">{`${item.transaction?.eth_hash.slice(
0,
8,
)}...${item.transaction.eth_hash.slice(-8)}`}</a>
)}...${item.transaction?.eth_hash.slice(-8)}`}</a>
</NextLink>
</span>
</Tooltip>
Expand All @@ -154,7 +154,7 @@ const ActivityList: React.FC<
<td>
{method ? (
<div
data-tooltip={item.transaction.method_id}
data-tooltip={item.transaction?.method_id}
className={`${styles.method} tooltip`}
title={method}
>
Expand All @@ -170,10 +170,10 @@ const ActivityList: React.FC<
</time>
</td>
<td>
<Address address={item.from_address} type={item.from_account.type} domain={fromBitAlias} />
<Address address={item.from_address} type={item.from_account?.type} domain={fromBitAlias} />
</td>
<td>
<Address address={item.to_address} type={item.to_account.type} domain={toBitAlias} />
<Address address={item.to_address} type={item.to_account?.type} domain={toBitAlias} />
</td>
{viewer ? (
<td>
Expand Down
12 changes: 6 additions & 6 deletions components/NFTActivityList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,16 @@ const ActivityList: React.FC<
const toBitAlias = item.to_account?.bit_alias

return (
<tr key={item.transaction.eth_hash + item.log_index}>
<tr key={item.transaction?.eth_hash + item.log_index}>
<td>
<div className={styles.hash}>
<Tooltip title={item.transaction.eth_hash} placement="top">
<Tooltip title={item.transaction?.eth_hash} placement="top">
<span>
<NextLink href={`/tx/${item.transaction.eth_hash}`}>
<a className="mono-font">{`${item.transaction.eth_hash.slice(
<NextLink href={`/tx/${item.transaction?.eth_hash}`}>
<a className="mono-font">{`${item.transaction?.eth_hash.slice(
0,
8,
)}...${item.transaction.eth_hash.slice(-8)}`}</a>
)}...${item.transaction?.eth_hash.slice(-8)}`}</a>
</NextLink>
</span>
</Tooltip>
Expand All @@ -143,7 +143,7 @@ const ActivityList: React.FC<
</td>
<td>
{method ? (
<Tooltip title={item.transaction.method_id} placement="top">
<Tooltip title={item.transaction?.method_id} placement="top">
<div className={styles.method} title={method}>
{method}
</div>
Expand Down

0 comments on commit 12c60b4

Please sign in to comment.