web-examples icon indicating copy to clipboard operation
web-examples copied to clipboard

In React Wallet v2 the modal closes if another request is made right after connecting

Open kujtimprenkuSQA opened this issue 1 year ago • 0 comments

Note this can be reproduced only after this other PR is merged: https://github.com/WalletConnect/web-examples/pull/301

There's a "strange" behavior when making another request like near_signIn right after the connect has been approved as shown in the video below:

walletconnect-issue.webm

What I suspect is that this line ModalStore.close() in SessionProposalModal is executed a bit later then the new session_request for near_signIn has been made. As shown in the video right after clicking "Approve" the request for near_signIn shows for a split second and the modal gets closed without giving a chance to either approve or reject.

If we add some waiting time between the connect and another request in a dApp then the modals open and close correctly, but this is not an ideal solution

// this is some dummy pseudo code
await signClient.connect(params)

await wait(1000) // wait for 1 sec

// make a new request
await signClient.request(params)

kujtimprenkuSQA avatar Oct 04 '23 13:10 kujtimprenkuSQA