Skip to content

Commit

Permalink
feat: #51 from hexaonelabs/dev
Browse files Browse the repository at this point in the history
fix: handle unexisting fungible info
  • Loading branch information
FazioNico authored Jun 26, 2024
2 parents b0cda15 + aac5d8e commit ffc291f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/components/ui/WalletTxEntity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export function WalletTxEntity(props: { tx: TxInterface }) {
onError={(event) => {
(
event.target as any
).src = `https://images.placeholders.dev/?width=42&height=42&text=${action1.fungible_info.symbol}&bgColor=%23cccccc&textColor=%23182449`;
).src = `https://images.placeholders.dev/?width=42&height=42&text=${action1?.fungible_info?.symbol}&bgColor=%23cccccc&textColor=%23182449`;
}}
/>
</IonAvatar>
Expand All @@ -155,7 +155,7 @@ export function WalletTxEntity(props: { tx: TxInterface }) {
(action1 as Transfer).direction === 'in' ? '+ ' : '- '
)}
{action1.quantity.float.toFixed(3) + ' '}
{action1.fungible_info.symbol}
{action1?.fungible_info?.symbol}
{tx.attributes.operation_type !== 'approve' && (
<IonText color="medium">
<br/><small>{currencyFormat.format((action1 as Transfer).value)}</small>
Expand All @@ -173,22 +173,22 @@ export function WalletTxEntity(props: { tx: TxInterface }) {
}}>
<img
src={
action2.fungible_info.icon?.url || `https://images.placeholders.dev/?width=42&height=42&text=${action2.fungible_info.symbol}&bgColor=%23cccccc&textColor=%23182449`
action2.fungible_info.icon?.url || `https://images.placeholders.dev/?width=42&height=42&text=${action2?.fungible_info?.symbol}&bgColor=%23cccccc&textColor=%23182449`
}
alt={tx.relationships.chain.data.id}
style={{ transform: "scale(1.01)" }}
onError={(event) => {
(
event.target as any
).src = `https://images.placeholders.dev/?width=42&height=42&text=${action2.fungible_info.symbol}&bgColor=%23cccccc&textColor=%23182449`;
).src = `https://images.placeholders.dev/?width=42&height=42&text=${action2?.fungible_info?.symbol}&bgColor=%23cccccc&textColor=%23182449`;
}}
/>
</IonAvatar>
<IonText>
<p className="ion-no-margin">
{(action2 as Transfer).direction === 'in' ? '+ ' : '- '}
{action2.quantity.float.toFixed(3) + ' '}
{action2.fungible_info.symbol}
{action2?.fungible_info?.symbol}
<IonText color="medium">
<br/><small>{currencyFormat.format((action2 as Transfer).value)}</small>
</IonText>
Expand Down
2 changes: 1 addition & 1 deletion src/containers/desktop/TokenDetailDesktopContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const TokenDetailDesktopContainer = (props: {

const filteredTxs = txs.filter((tx) => {
return tx.attributes.transfers.some((transfer) => {
return transfer.fungible_info.symbol === data.symbol;
return transfer?.fungible_info?.symbol === data.symbol;
});
});

Expand Down
2 changes: 1 addition & 1 deletion src/containers/mobile/TokenDetailMobileContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const TokenDetailMobileContainer = (props: {

const filteredTxs = txs.filter((tx) => {
return tx.attributes.transfers.some((transfer) => {
return transfer.fungible_info.symbol === data.symbol;
return transfer?.fungible_info?.symbol === data.symbol;
});
});

Expand Down

0 comments on commit ffc291f

Please sign in to comment.