web3-react icon indicating copy to clipboard operation
web3-react copied to clipboard

Cannot activate WalletConnect after click close button(The user rejected the request)...

Open ChrisChan888 opened this issue 3 years ago • 6 comments

dependencies: "@web3-react/walletconnect-connector": "^6.2.8", I cannot activate WalletConnect again after click close button below... Screenshot 2022-01-21 at 6 39 13 PM

ChrisChan888 avatar Jan 21 '22 10:01 ChrisChan888

Yup, can reproduce this.

ross-rosario avatar Feb 23 '22 21:02 ross-rosario

would accept a bug fix PR for this

NoahZinsmeister avatar Feb 24 '22 22:02 NoahZinsmeister

fwiw this may be an issue in walletconnect itself: https://github.com/WalletConnect/walletconnect-monorepo/issues/747

tinaszheng avatar Mar 07 '22 06:03 tinaszheng

tina is correct, and also this only affects v6 (it's handled via a workaround in v8)

NoahZinsmeister avatar Mar 08 '22 02:03 NoahZinsmeister

I workaround by set the walletConnectProvider to undefined before activate

import { WalletConnectConnector } from '@web3-react/walletconnect-connector';

const walletConnect = new WalletConnectConnector({
  infuraId: process.env.NEXT_PUBLIC_INFURA_ID,
});

async function connectWalletConnect() {
    walletConnect.walletConnectProvider = undefined;
    try {
      await activate(walletConnect,);
    } catch (ex) {
      console.log(ex);
    }
 }

phattranky avatar Mar 13 '22 03:03 phattranky

I have a question,where is the "activate" method from? Which library should I to import?

Himawarinoyakusoku avatar Sep 15 '22 09:09 Himawarinoyakusoku