diff --git a/apps/block_scout_web/assets/js/pages/chain.js b/apps/block_scout_web/assets/js/pages/chain.js index e6d9c40244..31bde04dfd 100644 --- a/apps/block_scout_web/assets/js/pages/chain.js +++ b/apps/block_scout_web/assets/js/pages/chain.js @@ -154,6 +154,7 @@ const elements = { if (chart && !(oldState.availableSupply === state.availableSupply && oldState.marketHistoryData === state.marketHistoryData) && state.availableSupply) { chart.updateMarketHistory(state.availableSupply, state.marketHistoryData) } + if (chart && !(JSON.stringify(oldState.transactionStats) === JSON.stringify(state.transactionStats))) { chart.updateTransactionHistory(state.transactionStats) } @@ -195,6 +196,13 @@ const elements = { $el.empty().append(formatUsdValue(state.usdMarketCap)) } }, + '[data-selector="tx_per_day"]': { + render ($el, state, oldState) { + if (!(JSON.stringify(oldState.transactionStats) === JSON.stringify(state.transactionStats))) { + $el.empty().append(state.transactionStats[0].number_of_transactions) + } + } + }, '[data-selector="chain-block-list"]': { load ($el) { return { diff --git a/apps/block_scout_web/lib/block_scout_web/templates/chain/show.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/chain/show.html.eex index d5f0fcab0f..09e0db4654 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/chain/show.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/chain/show.html.eex @@ -71,7 +71,7 @@ <%= gettext "Tx/day" %> - + <%= Enum.at(@transaction_stats, 0).number_of_transactions %>