Skip to content
This repository has been archived by the owner on Sep 27, 2019. It is now read-only.

Commit

Permalink
do not use polling for new metamask provider
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianmcli committed Oct 21, 2018
1 parent 52955c6 commit 36e2758
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 76 deletions.
71 changes: 34 additions & 37 deletions dist/drizzle.js

Large diffs are not rendered by default.

70 changes: 34 additions & 36 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/drizzleStatus/drizzleStatusSaga.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ function * initializeDrizzle (action) {

const syncAlways = options.syncAlways

if (web3.currentProvider.isMetaMask) {
// Using MetaMask, attempt block polling.
if (web3.currentProvider.isMetaMask && !window.ethereum) {
// Using old MetaMask, attempt block polling.
const interval = options.polls.blocks
yield put({ type: 'BLOCKS_POLLING', drizzle, interval, web3, syncAlways })
} else {
// Not using MetaMask, attempt subscription block listening.
// Not using old MetaMask, attempt subscription block listening.
yield put({ type: 'BLOCKS_LISTENING', drizzle, web3, syncAlways })
}

Expand Down

0 comments on commit 36e2758

Please sign in to comment.