Reload transactions on the main page without reloading of the whole page

pull/4241/head
Viktor Baranov 4 years ago
parent 4ae3843ffa
commit 2c88056a8f
  1. 1
      CHANGELOG.md
  2. 16
      apps/block_scout_web/assets/js/pages/chain.js
  3. 4
      apps/block_scout_web/lib/block_scout_web/templates/chain/show.html.eex

@ -1,6 +1,7 @@
## Current
### Features
- [#4241](https://github.com/blockscout/blockscout/pull/4241) - Reload transactions on the main page without reloading of the whole page
- [#4218](https://github.com/blockscout/blockscout/pull/4218) - Hide long arrays in smart-contract's
- [#4205](https://github.com/blockscout/blockscout/pull/4205) - Total transactions fees per day API endpoint
- [#4158](https://github.com/blockscout/blockscout/pull/4158) - Calculate total fee per day

@ -124,6 +124,11 @@ function baseReducer (state = initialState, action) {
})
}
}
case 'TRANSACTION_BATCH_EXPANDED': {
return Object.assign({}, state, {
transactionsBatch: []
})
}
case 'RECEIVED_UPDATED_TRANSACTION_STATS': {
return Object.assign({}, state, {
transactionStats: action.msg.stats
@ -339,6 +344,17 @@ if ($chainDetailsPage.length) {
type: 'RECEIVED_UPDATED_TRANSACTION_STATS',
msg: msg
}))
const $txReloadButton = $('[data-selector="reload-transactions-button"]')
const $channelBatching = $('[data-selector="channel-batching-message"]')
$txReloadButton.on('click', (event) => {
event.preventDefault()
loadTransactions(store)
$channelBatching.hide()
store.dispatch({
type: 'TRANSACTION_BATCH_EXPANDED'
})
})
}
function loadTransactions (store) {

@ -236,8 +236,8 @@
<div class="card-body">
<%= link(gettext("View All Transactions"), to: transaction_path(BlockScoutWeb.Endpoint, :index), class: "btn-line float-right") %>
<h2 class="card-title lg-card-title"><%= gettext "Transactions" %></h2>
<div data-selector="channel-batching-message" class="d-none">
<div data-selector="reload-button" class="alert alert-info">
<div data-selector="channel-batching-message" style="display: none;">
<div data-selector="reload-transactions-button" class="alert alert-info">
<a href="#" class="alert-link"><span data-selector="channel-batching-count"></span> <%= gettext "More transactions have come in" %></a>
</div>
</div>

Loading…
Cancel
Save