Skip to content

[Bug]: Changing wallets on account center doesn't change accounts #1219

@AlissonRS

Description

@AlissonRS

Current Behavior

Changing wallets in the floating account center on top is not triggering connectedWallet computed property provided by useOnboard in Vue. In fact, it's not even changing the current account in MetaMask for example, so if I wanted to ask the user to sign a transaction, it'd open metamask with a different account than the one selected in the account center.

Changing the network from the Account Center is working though, it opens MetaMask and prompt the user to switch network.

This is a problem because if users are using multiple accounts in the Account Center, I'm not able to detect when they change the account, so I'm still showing data from the first selected wallet.

The problem doesn't seem related to Vue itself, when I change accounts directly from MetaMask, the computed properties are fired, but when changing from Account Center, I was expecting it to prompt MetaMask for switching account (or firing the computed property), so the problem seems related to the Core package, not Vue package.

image

Expected Behavior

Changing the wallet should fire the computed properties provided by useOnboard, OR/AND should change the current wallet on MetaMask.

Steps To Reproduce

  1. Connect to a wallet using web3-onboard.
  2. From action center, click "Connect another wallet". This will prompt MetaMask for account selection.
  3. From MetaMask, select a second wallet.
  4. The computed properties are fired as expected here.
  5. Open the Account Center, choose the first wallet.
  6. Now the computed properties are not fired, and in MetaMask the account is not changed either (should prompt the user).

What package is effected by this issue?

@web3-onboard/core

Is this a build or a runtime issue?

Runtime

Package Version

2.4.0

Node Version

16.13.2

What browsers are you seeing the problem on?

Chrome

Relevant log output

No response

Anything else?

No response

Sanity Check

  • If this is a build issue, I have included my build config. If this is a runtime issue, I have included reproduction steps and/or a Minimal, Reproducible Example.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions