Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

332
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda