File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -180,7 +180,9 @@ export const useNetworkState = () => {
180180 if ( ! current ) {
181181 return previous
182182 }
183- if ( current . blockNumber !== blockNumber || current . specVersion !== specVersion ) {
183+ const currentBlockNumber = current . blockNumber
184+ const currentSpecVersion = current . specVersion
185+ if ( currentSpecVersion !== specVersion || currentBlockNumber == null || currentBlockNumber < blockNumber ) {
184186 return previous
185187 }
186188 const nextAttempts = Math . max ( 0 , Math . trunc ( attempts ) )
@@ -314,7 +316,8 @@ export const useNetworkState = () => {
314316 if ( ! current ) {
315317 return previous
316318 }
317- if ( current . blockNumber !== blockNumber || current . specVersion !== specVersion ) {
319+ const currentBlockNumber = current . blockNumber
320+ if ( current . specVersion !== specVersion || ( currentBlockNumber != null && currentBlockNumber < blockNumber ) ) {
318321 return previous
319322 }
320323 const currentUpgrade = current . upgradedAt
@@ -348,7 +351,8 @@ export const useNetworkState = () => {
348351 if ( ! current ) {
349352 return previous
350353 }
351- if ( current . blockNumber !== blockNumber || current . specVersion !== specVersion ) {
354+ const currentBlockNumber = current . blockNumber
355+ if ( current . specVersion !== specVersion || ( currentBlockNumber != null && currentBlockNumber < blockNumber ) ) {
352356 return previous
353357 }
354358 if ( current . upgradeError === formattedMessage ) {
You can’t perform that action at this time.
0 commit comments