From 5ded9ee9e7cc20b3fe99d69691860d80824ccee3 Mon Sep 17 00:00:00 2001 From: nicolas Date: Tue, 9 Mar 2021 12:46:09 -0300 Subject: [PATCH] Fix: History and Queue pagination (#2003) --- .../Transactions/TxList/HistoryTransactions.tsx | 2 +- .../components/Transactions/TxList/QueueTransactions.tsx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/routes/safe/components/Transactions/TxList/HistoryTransactions.tsx b/src/routes/safe/components/Transactions/TxList/HistoryTransactions.tsx index 9bba9e11..75f42967 100644 --- a/src/routes/safe/components/Transactions/TxList/HistoryTransactions.tsx +++ b/src/routes/safe/components/Transactions/TxList/HistoryTransactions.tsx @@ -11,7 +11,7 @@ import NoTransactionsImage from './assets/no-transactions.svg' export const HistoryTransactions = (): ReactElement => { const { count, hasMore, next, transactions, isLoading } = usePagedHistoryTransactions() - if (isLoading || !transactions) { + if (count === 0 && isLoading) { return ( diff --git a/src/routes/safe/components/Transactions/TxList/QueueTransactions.tsx b/src/routes/safe/components/Transactions/TxList/QueueTransactions.tsx index 7c6ee471..5339a6dc 100644 --- a/src/routes/safe/components/Transactions/TxList/QueueTransactions.tsx +++ b/src/routes/safe/components/Transactions/TxList/QueueTransactions.tsx @@ -14,9 +14,7 @@ import { TxLocationContext } from './TxLocationProvider' export const QueueTransactions = (): ReactElement => { const { count, isLoading, hasMore, next, transactions } = usePagedQueuedTransactions() - // `loading` is, actually `!transactions` - // added the `transaction` verification to prevent `Object is possibly 'undefined'` error - if (isLoading || !transactions) { + if (count === 0 && isLoading) { return ( @@ -24,7 +22,9 @@ export const QueueTransactions = (): ReactElement => { ) } - if (count === 0) { + // `loading` is, actually `!transactions` + // added the `transaction` verification to prevent `Object is possibly 'undefined'` error + if (count === 0 || !transactions) { return ( No Transactions yet