useDApp icon indicating copy to clipboard operation
useDApp copied to clipboard

Using `switchNetwork` causes the currently-connected wallet to disconnect

Open JayWelsh opened this issue 2 years ago • 2 comments

Describe the bug The switchNetwork function should prompt a connected wallet to switch to the target network, but it shouldn't cause the connected wallet to disconnect from the web frontend after successfully changing networks.

To Reproduce

  1. Navigate to the switchNetwork documentation at: https://usedapp-docs.netlify.app/docs/Guides/Transactions/Switching%20Networks
  2. Use any of the demo switch network buttons under the "example" section
  3. The vast majority of the time, a network switch will cause the connected wallet to disconnect and you will see that the switch network buttons disappear and become just a "connect" button. Very occasionally a disconnect won't occur.

Software versions

  • useDapp version: v1.2.10
  • Package manager: yarn
  • Node version: v16.14.2

Additional context

https://github.com/TrueFiEng/useDApp/assets/14224459/15bd53b2-ec45-4f43-9393-a6fa8b147461

JayWelsh avatar Jul 10 '23 12:07 JayWelsh