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() { ...@@ -19,9 +19,9 @@ function useUpdateChainBlock() {
(block: number) => { (block: number) => {
setChainBlock((chainBlock) => { setChainBlock((chainBlock) => {
if (chainBlock.chainId === chainId) { if (chainBlock.chainId === chainId) {
if (chainBlock.block === block) return chainBlock if (!chainBlock.block || chainBlock.block < block) {
if (typeof chainBlock.block !== 'number') return { chainId, block } return { chainId, block }
return { chainId, block: Math.max(block, chainBlock.block) } }
} }
return chainBlock 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