From d56acfb29a1d877a45d95d39dea53bc1a7a4e91f Mon Sep 17 00:00:00 2001 From: Keith Date: Thu, 14 Dec 2023 17:32:59 +0900 Subject: [PATCH] docs: add comments about the type declaration to fix --- src/models/Transaction/index.ts | 1 + src/pages/Address/index.tsx | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/models/Transaction/index.ts b/src/models/Transaction/index.ts index 080cc9cfa..0d5ddf443 100644 --- a/src/models/Transaction/index.ts +++ b/src/models/Transaction/index.ts @@ -10,6 +10,7 @@ export interface CellDep { export interface Transaction { transactionHash: string + // FIXME: this type declaration should be fixed by adding a transformation between internal state and response of API blockNumber: number | string blockTimestamp: number | string transactionFee: string diff --git a/src/pages/Address/index.tsx b/src/pages/Address/index.tsx index f68c0b38c..41db406d6 100644 --- a/src/pages/Address/index.tsx +++ b/src/pages/Address/index.tsx @@ -82,7 +82,8 @@ export const Address = () => { const transactionCounts: Record<'committed' | 'pending', number | '-'> = { committed: addressInfoQuery.isFetched && addressInfoQuery.data - ? Number(addressInfoQuery.data.transactionsCount) ?? '-' + ? // FIXME: this type convertion could be removed once the type declaration of Transaction is fixed + Number(addressInfoQuery.data.transactionsCount) ?? '-' : '-', pending: pendingTransactionCountQuery.isFetched ? pendingTransactionCountQuery.data ?? '-' : '-', }