Closed PaulRBerg closed 4 years ago
It happens only when I first open a plugin page. If I land on a plugin after seeing the home page, it works fine.
I suspect that it has to do with updating props downstream. The account in the top-right corner shows up correctly as the account from MetaMask, but the plugin's props (web3
, accounts
and defaultAccount
) all return the local burner account.
Thanks to @dmihal and his awesome tech support, I solved this issue by moving the code in componentDidUpdate
instead of componentDidMount
. I don't think this is a bug per se, but it is something worth mentioning in the README/ dev guide imo.
Current Behavior
The
defaultAccount
andaccounts
props look like this in the console:Whereas my MetaMask account is
0x4bcb303609F19e71Ab82A3A3393c46BfEa1e44Fc
.Expected Behavior
The
accounts
anddefaultAccount
should be the accounts of MetaMask.