Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiebee committed Feb 12, 2019
1 parent 7e64a57 commit c10fb3c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/scripts/controllers/recent-blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,19 @@ class RecentBlocksController {
log.error(err)
}
}
let isListeng = false
let isListening = false
const { type } = networkController.getProviderConfig()
if (!INFURA_PROVIDER_TYPES.includes(type) && type !== 'loading') {
this.blockTracker.on('latest', blockListner)
isListeng = true
isListening = true
}
networkController.on('networkDidChange', (newType) => {
if (INFURA_PROVIDER_TYPES.includes(newType) && isListeng) {
if (INFURA_PROVIDER_TYPES.includes(newType) && isListening) {
this.blockTracker.removeListener('latest', blockListner)
} else if (
!INFURA_PROVIDER_TYPES.includes(type) &&
type !== 'loading' &&
!isListeng
!isListening
) {
this.blockTracker.on('latest', blockListner)

Expand Down

0 comments on commit c10fb3c

Please sign in to comment.