From 07e7251a2334f3dc5d469d17a798d535d684dcd4 Mon Sep 17 00:00:00 2001 From: Kristof Csillag Date: Thu, 9 Jan 2025 03:59:55 +0100 Subject: [PATCH] Improve handling of situations when the TX list is empty This can happen when filtering for TX method. --- src/app/components/Transactions/RuntimeTransactions.tsx | 1 + src/app/pages/RuntimeTransactionsPage/index.tsx | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/components/Transactions/RuntimeTransactions.tsx b/src/app/components/Transactions/RuntimeTransactions.tsx index f3b58d9bcd..c975a93dea 100644 --- a/src/app/components/Transactions/RuntimeTransactions.tsx +++ b/src/app/components/Transactions/RuntimeTransactions.tsx @@ -202,6 +202,7 @@ export const RuntimeTransactions: FC = ({ name={t('transactions.latest')} isLoading={isLoading} pagination={pagination} + emptyMessage={'No transactions found.'} /> ) } diff --git a/src/app/pages/RuntimeTransactionsPage/index.tsx b/src/app/pages/RuntimeTransactionsPage/index.tsx index 6228540fa4..e1823097b5 100644 --- a/src/app/pages/RuntimeTransactionsPage/index.tsx +++ b/src/app/pages/RuntimeTransactionsPage/index.tsx @@ -86,7 +86,9 @@ export const RuntimeTransactionsPage: FC = () => { const { isLoading, isFetched, data } = transactionsQuery const transactions = data?.data.transactions - setBeforeDateFromCollection(data?.data.transactions[0].timestamp) + if (transactions?.length) { + setBeforeDateFromCollection(data?.data.transactions[0].timestamp) + } if (isFetched && pagination.selectedPage > 1 && !transactions?.length) { throw AppErrors.PageDoesNotExist