MetaMask / metamask-extension

:globe_with_meridians: :electric_plug: The MetaMask browser extension enables browsing Ethereum blockchain enabled websites

Home Page:https://metamask.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

manually connect accountsChanged

gpersoon opened this issue · comments

Describe the bug
The callback for accountsChanged isn't called when you mannually connect a account

Steps to reproduce

  1. Have a website that contains the following piece of code:
ethereum.on('accountsChanged', newActs)
async function newActs() { 
    var acts=await web3.eth.getAccounts()
    console.log(`We have accounts: ${JSON.stringify(acts)}`);
}
  1. manually disconnect all accounts within metamask:
    Then you see updates that the account is disconnected.
    Finally you end up with [] (e.g. no accounts connected)

  2. manually connect an account (via .../ connected sites / manually connect to current site / next / connect)
    Now nothing happens (e.g. no callback of accountsChanged)

Expected behavior
I would expect a callback of accountsChanged because we indeed have a new account

Browser details

  • OS Windows 10
  • Browser: Chrome Version 87.0.4280.66 (Official Build) (64-bit) (same occurs on firefox)
  • Metamask Version 8.1.3

I have confirmed that this is reproducible on develop