walletconnect-monorepo icon indicating copy to clipboard operation
walletconnect-monorepo copied to clipboard

Do not reopen modal when using disconnect()

Open hazae41 opened this issue 4 years ago • 18 comments

Hey, when I call disconnect(), the modal reopens; any way to disable this? I want to fully disconnect and use the app as a guest/unknown user

hazae41 avatar Feb 07 '21 17:02 hazae41

@hazae41 Are you using the walletconnect web3-provider?

jrhender avatar Feb 09 '21 22:02 jrhender

Yes

hazae41 avatar Feb 09 '21 22:02 hazae41

I might be seeing the same issue. What seems to be happening in my case is that after calling WalletConnectProvider.close(), WalletConnectProvider.handleRequest is called again which in turn calls getWalletConnector which triggers a new call to the connector's createSession. Is that what seems to be happening in your case?

jrhender avatar Feb 09 '21 22:02 jrhender

I don't know, it just reopens when I call .disconnect()

hazae41 avatar Feb 09 '21 23:02 hazae41

+1

joeandrews avatar Feb 12 '21 19:02 joeandrews

Implemented a workaround of extending WalletConnect to override createSession https://github.com/energywebfoundation/iam-client-lib/commit/42ee4391701a66161d1a3a2c8cbac5e5aaf143d4#diff-25a6634263c1b1f6fc4697a04e2b9904ea4b042a89af59dc93ec1f5d44848a26

jrhender avatar Mar 12 '21 16:03 jrhender

+1

pxr64 avatar Apr 24 '21 14:04 pxr64

The only workaround I had is to use the standalone client and use my own Web3 layer https://docs.walletconnect.org/quick-start/dapps/client

hazae41 avatar May 06 '21 09:05 hazae41

+1 This is still an issue for me in web3-provider v1.7.1. Thanks for your help @jrhender .

anastasiosna avatar Jan 30 '22 00:01 anastasiosna

+1

steviesocks avatar Feb 02 '22 23:02 steviesocks

+1

0xSzeth avatar Mar 02 '22 20:03 0xSzeth

+1

swaxtic avatar Mar 31 '22 11:03 swaxtic

+1

Shilza avatar May 31 '22 14:05 Shilza

+1

pawelmiklas avatar Jun 02 '22 09:06 pawelmiklas

+1 in v1.7.8

ivanhdzd avatar Aug 14 '22 16:08 ivanhdzd

+1

allisonle avatar Aug 23 '22 08:08 allisonle

The only workaround I had is to use the standalone client and use my own Web3 layer https://docs.walletconnect.org/quick-start/dapps/client

what do you mean by your own Web3 layer? How are you getting a provider instance from the standalone client?

luca992 avatar Sep 06 '22 22:09 luca992

The only workaround I had is to use the standalone client and use my own Web3 layer https://docs.walletconnect.org/quick-start/dapps/client

what do you mean by your own Web3 layer? How are you getting a provider instance from the standalone client?

Even better, I'm gonna build my own client and modal.

image

hazae41 avatar Sep 07 '22 13:09 hazae41

@hazae41 is this still an issue?

finessevanes avatar Dec 13 '22 03:12 finessevanes