Skip to content

Commit

Permalink
chore(webapp): update evm last block card with every request
Browse files Browse the repository at this point in the history
  • Loading branch information
Torresmorah committed Nov 3, 2023
1 parent cc14eb4 commit 87d29cd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions webapp/src/routes/EVMDashboard/useEVMstate.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,8 @@ const useEVMState = t => {

useEffect(() => {
const updateStats = async () => {
const lastBlock = await ethApi.getLastBlock()

setEVMStats(prev => ({
...prev,
last_block: lastBlock,
...(historicalStats && historicalStats.evm_historical_stats[0]),
...(stats && stats.evm_stats[0]),
}))
Expand Down Expand Up @@ -190,6 +187,11 @@ const useEVMState = t => {
blockNum = await ethApi.getLastBlock()
}

setEVMStats(prev => ({
...prev,
last_block: blockNum,
}))

if (!pauseRef.current) {
ethApi.getBlock(blockNum).then(block => {
setBlockList(prev => {
Expand Down

0 comments on commit 87d29cd

Please sign in to comment.