Closed ghost closed 3 years ago
Argent has this problem 100% of the time.
See the error message below. This bug is a blocker for Argent integration. It is reproducible 100% of the time by Argent devs.
Error fixed on yearn.finance but not on y.finance.
@Sowul y.finance now redirects to yearn.finance
I suspect we are seeing this error due to the way we initialize web3.
Currently we dispatch a CONNECTION_CONNECTED event in
src/App.js
ifwindow.ethereum
is available.We cannot rely on
window.ethereum
being available upon app initialization.window.ethereum
is not immediately available for mobile devices.We need to follow Metamask's "best practices" guide and add an event listener to listen for ethereum initialization. If we do this this may resolve some of our mobile issues.
https://docs.metamask.io/guide/mobile-best-practices.html#the-provider-window-ethereum