Closed andytudhope closed 7 years ago
fixed by adding let web3 = window.web3 in getWeb3.js
window.web3 does not always provide a consistent API. I've had several issues with this on mobile dApp browsers, since it was returning an older version of web3 with different API. The solution is to use new Web3(Web3.currentProvider)
instead, where Web3 is the one imported from the dependencies, not the one in the window.
The latest commit that changes how the web3 object is handled seems to break things for me. It does not see the injected web3 object and defaults to the local one every time, no matter which network I connect MetaMask to.
OS: Mac 10.12.5 Browser: Chrome
I'm a newb to React, so forgive me, but my sense was that there was something amiss with the lifecycle hooks and waiting for the
load
event. I tried changing the code inapp.js
to make a button that would only callgetWeb3
when clicked, but that failed even more, so the issue is definitely with the getWeb3.js file. I'm just not sure how to edit it to get it to pick up the injected web3 at the right time...