Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Number of Transactions & Total Transactions from Activity Page #2612

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions app/actions/transactionHistoryActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ export default createActions(
shouldIncrementPagination = false,
}: Props = {}) => async () => {
const { chain } = await getSettings()
const network = net === 'MainNet' ? 'mainnet' : 'testnet'

// If refresh action dispatched reset pagination
// to grab the most recent abstracts
Expand All @@ -218,12 +219,9 @@ export default createActions(
let count = 0

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)
} else {
const network = net === 'MainNet' ? 'mainnet' : 'testnet'
const data = await NeoLegacyREST.getAddressAbstracts(
address,
page,
Expand All @@ -233,12 +231,21 @@ export default createActions(
parsedEntries = await parseAbstractData(data.entries, address, net)
}
page += 1

// check to see if there is another page
let nextPage = true
const testData = await NeoRest.addressTXFull(address, page, network)
if (typeof testData.totalCount === 'undefined') nextPage = false

if (shouldIncrementPagination) {
if (page === 1) entries = []
entries.push(...parsedEntries)
// handle the option to load more transactions for neo3
if (chain === 'neo3' && nextPage === false) count = entries.length
return { entries, count }
}
entries = [...parsedEntries]
if (chain === 'neo3' && nextPage === 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