Skip to content

Commit

Permalink
fixed recent transaction to/from
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen-Gordon committed Apr 1, 2024
1 parent 7c5da31 commit 7db9052
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/app/components/RecentTransaction/RecentTransaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ export default function RecentTransaction({ transaction }: any) {

const contactsState = useSelector((state: RootState) => state.contacts.value);

const payeeName = useFindPayeeName(transaction.to, contactsState);
const payeeName =
transaction.from.toLocaleLowerCase() !== address?.toLocaleLowerCase()
? useFindPayeeName(transaction.from, contactsState)
: useFindPayeeName(transaction.to, contactsState);

const dispatch = useDispatch();

Expand All @@ -62,7 +65,8 @@ export default function RecentTransaction({ transaction }: any) {
? 'From '
: 'To '}

{payeeName}
{payeeName}

</div>
<p className='text-muted-foreground text-sm'>
<TimeAgo date={fromUnixTime(transaction.timeStamp)} />
Expand Down

0 comments on commit 7db9052

Please sign in to comment.