Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Commit

Permalink
fix: trailing chars in memo string, closes #242
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranjamie committed Sep 25, 2020
1 parent c6f2fa2 commit 0573dc7
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ export const TransactionListItem: FC<TransactionListItemProps> = args => {
const sumPrefix = direction === 'sent' ? '−' : '';
const memo =
tx.tx_type === 'token_transfer' &&
Buffer.from(tx.token_transfer.memo.replace('0x', ''), 'hex').toString('utf8');
Buffer.from(tx.token_transfer.memo.replace('0x', '').replace(/^0+|0+$/g, ''), 'hex').toString(
'utf8'
);
const txDate = new Date(tx.burn_block_time_iso);
const txDateFormatted = new Intl.DateTimeFormat('en-US', dateOptions).format(txDate);

Expand Down

0 comments on commit 0573dc7

Please sign in to comment.