From 46cffd9f8d2e8aa5c40a892a0472e6cb7e81ebbf Mon Sep 17 00:00:00 2001 From: Keith Date: Mon, 23 Sep 2024 03:03:03 +0900 Subject: [PATCH 1/2] fix: handle exception of null type hash --- src/pages/Transaction/TransactionCell/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/Transaction/TransactionCell/index.tsx b/src/pages/Transaction/TransactionCell/index.tsx index 50739dafe..f6d7e50fd 100644 --- a/src/pages/Transaction/TransactionCell/index.tsx +++ b/src/pages/Transaction/TransactionCell/index.tsx @@ -305,7 +305,7 @@ const TransactionCellCapacityAmount = ({ cell }: { cell: Cell }) => { return {`${parseUDTAmount(amount, udtInfo.decimal)} ${udtInfo.symbol}`} } - return {`${t('udt.unknown_token')} #${udtInfo.typeHash.substring(udtInfo.typeHash.length - 4)}`} + return {`${t('udt.unknown_token')} #${udtInfo.typeHash?.substring(udtInfo.typeHash.length - 4)}`} } return From ee18ca049eb79ba30d78a1a1a479be2e0ef91e15 Mon Sep 17 00:00:00 2001 From: Keith Date: Mon, 23 Sep 2024 03:11:29 +0900 Subject: [PATCH 2/2] fix: use '?' instead of 'undefined' --- src/pages/Transaction/TransactionCell/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/Transaction/TransactionCell/index.tsx b/src/pages/Transaction/TransactionCell/index.tsx index f6d7e50fd..7fb02145d 100644 --- a/src/pages/Transaction/TransactionCell/index.tsx +++ b/src/pages/Transaction/TransactionCell/index.tsx @@ -305,7 +305,7 @@ const TransactionCellCapacityAmount = ({ cell }: { cell: Cell }) => { return {`${parseUDTAmount(amount, udtInfo.decimal)} ${udtInfo.symbol}`} } - return {`${t('udt.unknown_token')} #${udtInfo.typeHash?.substring(udtInfo.typeHash.length - 4)}`} + return {`${t('udt.unknown_token')} #${udtInfo.typeHash.substring(udtInfo.typeHash.length - 4) ?? '?'}`} } return