Skip to content

Commit

Permalink
Fix pagination on transactionList
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienbarbier committed Apr 8, 2024
1 parent 52cf29e commit dfe4822
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/app/components/transactions/TransactionList.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ export default function TransactionList(props) {
// Handle transactions
//

console.log(props.pagination);

const { transactions, perDate } = useMemo(() => {

Check failure on line 72 in src/app/components/transactions/TransactionList.js

View workflow job for this annotation

GitHub Actions / build (20.11.1)

'transactions' is assigned a value but never used
let result = props.transactions || [];
let resultDate = [];
Expand All @@ -79,7 +81,7 @@ export default function TransactionList(props) {
}
});
result = result.sort(sortingFunction);
result.filter((item, index) => {
result = result.filter((item, index) => {
return !pagination || index < pagination;
});

Expand Down Expand Up @@ -355,12 +357,13 @@ export default function TransactionList(props) {
Delete
</MenuItem>
</Menu>

{!props.isLoading && pagination && pagination < transactions.length && (
<Button fullWidth onClick={() => more()} className="moreButton">
More
</Button>
)}
{!props.isLoading &&
pagination &&
pagination < props.transactions.length && (
<Button fullWidth onClick={() => more()} className="moreButton">
More
</Button>
)}
</div>
);
}

0 comments on commit dfe4822

Please sign in to comment.