Skip to content

Commit

Permalink
fix: transactionHistory list (#1408)
Browse files Browse the repository at this point in the history
- Closes #1406
  • Loading branch information
LuizAsFight authored Jul 8, 2024
1 parent 2c60633 commit 24840bf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/tidy-oranges-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"fuels-wallet": patch
---

TransactionList breaking when have a failed transaction
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { cssObj } from '@fuel-ui/css';
import { Box, Card, Copyable, Icon, Text } from '@fuel-ui/react';
import { Address, type TransactionSummary } from 'fuels';
import type { FC } from 'react';
import { type FC, useMemo } from 'react';
import { useNavigate } from 'react-router-dom';
import { Pages, shortAddress } from '~/systems/Core';

Expand Down Expand Up @@ -34,6 +34,12 @@ export const ActivityItem: TxItemComponent = ({
status,
} = useTxMetadata({ ownerAddress, transaction });

const address = useMemo(() => {
if (!toOrFromAddress) return;

return Address.fromDynamicInput(toOrFromAddress);
}, [toOrFromAddress]);

return (
<Card
css={styles.root}
Expand All @@ -56,9 +62,7 @@ export const ActivityItem: TxItemComponent = ({
<Box.Flex css={styles.row}>
<Box.Flex css={styles.fromToTextWrapper}>
<Text css={styles.label}>{toOrFromText}</Text>
<Text>
{shortAddress(Address.fromDynamicInput(toOrFromAddress).toB256())}
</Text>
<Text>{!!address && shortAddress(address.toB256())}</Text>
</Box.Flex>
{timeFormatted && (
<Box.Flex css={styles.item}>
Expand Down

0 comments on commit 24840bf

Please sign in to comment.