diff --git a/webapp/src/context/state.context.js b/webapp/src/context/state.context.js index 46937f65..269b1e88 100644 --- a/webapp/src/context/state.context.js +++ b/webapp/src/context/state.context.js @@ -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) @@ -227,7 +239,6 @@ export const useSharedState = () => { type: 'updateInfo', payload: info, }) - getBlock(info.head_block_num) } catch (error) { console.error(error) }