Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

330
Views
How to inform the user an account isn't active after disconnecting the currently active account in MetaMask?

Scenario...

  • User has connected two accounts to our DAPP via MetaMask.
  • User disconnects the currently active account.
  • User still has their other connected account but it isn't active in MetaMask.

In our DAPP we're listening for changes like this.

useEffect(() => {
  if (!window.ethereum) return;

  const onAccountsChange = (connectedAddresses) => {
    props.setActiveAddress(connectedAddresses[0]);
  };

  window.ethereum.on('accountsChanged', onAccountsChange);

  return () => {
    window.ethereum.off('accountsChanged', onAccountsChange);
  };
}, []);

This works great for switching accounts, but in the scenario above, it will setActiveAddress to the other connected account even though it isn't actually active in MetaMask.

dapp

In our DAPP we'd like to tell the user "Please open MetaMask and activate " to remove a small layer of possible confusion.

Is this possible?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!