Commit 71b20b43 authored by Zach Pomerantz's avatar Zach Pomerantz Committed by GitHub

fix: block number stability (#3684)

* fix: block number stability

* fix: chainBlock logic
parent ecfa179b
......@@ -19,9 +19,9 @@ function useUpdateChainBlock() {
(block: number) => {
setChainBlock((chainBlock) => {
if (chainBlock.chainId === chainId) {
if (chainBlock.block === block) return chainBlock
if (typeof chainBlock.block !== 'number') return { chainId, block }
return { chainId, block: Math.max(block, chainBlock.block) }
if (!chainBlock.block || chainBlock.block < block) {
return { chainId, block }
}
}
return chainBlock
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment