Fix: History and Queue pagination (#2003)

This commit is contained in:
nicolas 2021-03-09 12:46:09 -03:00 committed by GitHub
parent 639bb98423
commit 5ded9ee9e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -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 (
<Centered>
<Loader size="md" />

View File

@ -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 (
<Centered>
<Loader size="md" />
@ -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 (
<NoTransactions>
<Img alt="No Transactions yet" src={NoTransactionsImage} />