Merge pull request #2017 from MyCryptoHQ/fix-metamask-poll-again

Check for `web3` before polling network status for MetaMask
This commit is contained in:
Danny Skubak 2018-07-05 16:37:06 -04:00 committed by GitHub
commit 012a89bd62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -91,6 +91,9 @@ window.addEventListener('load', () => {
});
});
setInterval(handleMetaMaskPolling.bind(null, store), METAMASK_POLLING_INTERVAL);
/** @desc When MetaMask is loaded as an extension, watch for network changes. */
if ((window as any).web3) {
setInterval(handleMetaMaskPolling.bind(null, store), METAMASK_POLLING_INTERVAL);
}
export default store;