Skip to content

Commit

Permalink
fix(webapp): update transactions stats
Browse files Browse the repository at this point in the history
  • Loading branch information
Torresmorah committed Dec 12, 2022
1 parent 7d46aca commit daeab1a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion webapp/src/context/state.context.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,18 @@ export const useSharedState = () => {
})
}

useEffect(() => {
let block = state.info.head_block_num

if (!block) return

const updateTransactions = async () => {
await getBlock(block)
}

updateTransactions()
}, [state.info, getBlock])

const getBlock = async (block) => {
try {
const data = await eosApi.getBlock(block)
Expand Down Expand Up @@ -227,7 +239,6 @@ export const useSharedState = () => {
type: 'updateInfo',
payload: info,
})
getBlock(info.head_block_num)
} catch (error) {
console.error(error)
}
Expand Down

0 comments on commit daeab1a

Please sign in to comment.