From 0573dc77ab40ccd06debb65e1284459b0d5e69a7 Mon Sep 17 00:00:00 2001 From: kyranjamie Date: Thu, 17 Sep 2020 10:09:36 +0200 Subject: [PATCH] fix: trailing chars in memo string, closes #242 --- .../home/transaction-list/transaction-list-item.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/components/home/transaction-list/transaction-list-item.tsx b/app/components/home/transaction-list/transaction-list-item.tsx index fb3a4f3..969649d 100644 --- a/app/components/home/transaction-list/transaction-list-item.tsx +++ b/app/components/home/transaction-list/transaction-list-item.tsx @@ -42,7 +42,9 @@ export const TransactionListItem: FC = 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);