Skip to content

Commit

Permalink
remove totalCount
Browse files Browse the repository at this point in the history
  • Loading branch information
jseagrave21 committed Jan 28, 2024
1 parent 3295a1b commit baeb785
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
15 changes: 14 additions & 1 deletion app/actions/transactionHistoryActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,12 @@ export default createActions(
if (chain === 'neo3') {
const network = net === 'MainNet' ? 'mainnet' : 'testnet'
const data = await NeoRest.addressTXFull(address, page, network)
count = data.totalCount
parsedEntries = await computeN3Activity(data, address, net)
// check to see if there is another page
const nextPage = page + 1
const testData = await NeoRest.addressTXFull(address, nextPage, network)
const testCount = testData.totalCount
if (typeof testCount !== 'undefined') count = true
} else {
const network = net === 'MainNet' ? 'mainnet' : 'testnet'
const data = await NeoLegacyREST.getAddressAbstracts(
Expand All @@ -236,9 +240,18 @@ export default createActions(
if (shouldIncrementPagination) {
if (page === 1) entries = []
entries.push(...parsedEntries)
// handle the option to load more transactions for neo3
// eslint-disable-next-line
if (count == true) count = entries.length + 1
// eslint-disable-next-line
if (count == false) count = entries.length
return { entries, count }
}
entries = [...parsedEntries]
// eslint-disable-next-line
if (count == true) count = entries.length + 1
// eslint-disable-next-line
if (count == false) count = entries.length
return { entries, count }
},
)
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,11 @@ export default class TransactionHistory extends React.Component<Props> {
<Center
width="300px"
margin="auto"
paddingTop="12px"
paddingTop="36px"
paddingBottom="12px"
display="flex"
flexDirection="column"
>
<Box fontSize="14px" opacity={0.5} marginBottom="12px">
Displaying {transactions.length} of {count} transactions
</Box>

<Button
onClick={handleFetchAdditionalTxData}
primary
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7538,11 +7538,6 @@ dotenv-expand@^5.1.0:
resolved "https://registry.yarnpkg.com/dotenv-expand/-/dotenv-expand-5.1.0.tgz#3fbaf020bfd794884072ea26b1e9791d45a629f0"
integrity sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==

dotenv@16.3.1:
version "16.3.1"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.3.1.tgz#369034de7d7e5b120972693352a3bf112172cc3e"
integrity sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==

dotenv@^8.1.0, dotenv@^8.2.0:
version "8.6.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b"
Expand Down

0 comments on commit baeb785

Please sign in to comment.